This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?


On 07/22/2013 06:45 PM, Roland McGrath wrote:
> I have a hard time seeing why (b) would ever be useful.
> I think (c) was always the intended semantic of _SC_NPROCESSORS_CONF.

That's different than what we have implemented in glibc.

Why do you have a hard time seeing that (b) would be useful?

I see (b) being useful for:

* Detection of number of logical cpus that are in the
  system vs. number that are online.
  - Ask your admin to bring the rest of them online?

* Used to create a minimally sized structure to track 
  per-logical-CPU data.
  - As it is implemented _SC_NPROCESSORS_CONF is a minimal
    value. Fixing it to match your expected semantics e.g
    making it the number of possible CPUs, is going
    to make this value potentially much larger.

What use is there to knowing (c) except to choose to optimize
space vs. time and allocate sufficient resources to track all
possible cpus that system could have (only a reboot can change
this in linux right now)?

Comments?

Cheers,
Carlos.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]