Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed,  2 Mar 2016 17:26:25 +0100
From: Nathan Zadoks <nathan@...han7.eu>
To: musl@...ts.openwall.com
Cc: Nathan Zadoks <nathan@...han7.eu>
Subject: [PATCH 0/2] add sched_getcpu, take n+1

> Wrong macro in the #ifdef.
Whoops, thanks, fixed!

> Not a big deal, but usually in musl we use 0 rather than the NULL
> macro.
Learnt a new thing there - fixed!

> Actually I wondered if the function actually needs to take the useless
> extra 2 arguments, but I think for the sake of correctness it's best
> to do it this way -- the callee in the vdso has 3 args, so it should
> be called with the correct type.
The second argument actually needs to be null: it's an out pointer for
an identifier for the NUMA node. sched_getcpu doesn't have a spot for
returning it, so we pass a null pointer there, which ignores it.
The *third* argument is a pointer to a now-unused cache structure,
and could probably be omitted safely. It's required to be non-NULL on kernels
older than 2.6.23, but we'd just end up corrupting random memory there
instead of getting an EFAULT. Not worth saving a register zeroing instruction.

> Also tabs should be used for indention, not spaces.
Yup, noticed that one before, was saving the fix for the next patch email.

> One other thing I thought might be nice is initially committing the
> trivial syscall-only version that adds the public prototype, then
> doing vdso support as a separate commit, but if that's a pain to do
> don't worry about it.
No problem! Some git trickery later, I've got this sorted.

Patches coming up in the next two emails, I'm still figuring out this
git-send-email thing.

Nathan Zadoks (2):
  add sched_getcpu
  add sched_getcpu vDSO support

 arch/x86_64/syscall_arch.h |  2 ++
 include/sched.h            |  1 +
 src/sched/sched_getcpu.c   | 44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+)
 create mode 100644 src/sched/sched_getcpu.c

-- 
2.7.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.