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/18/2013 05:00 PM, KOSAKI Motohiro wrote:
> > Why application should think the cpus are 8? I mean cpu offlining is typically
> > not short term.
[snip]
On Thu, 18 Jul 2013, Carlos O'Donell wrote:
> The manual is wrong. 
> 
> You should use _SC_NPROCESSORS_ONLN.
> 
> The manual should be fixed.
> 
> There is no reason to recommend using configured processors to
> assist in achieving maximum parallelism performance.

Is that really so?  IIUC, on ARM, Linux kernel can dynamically bring CPUs
online/offline in response to load as a power saving measure, and for example
if you run 'top' you'll see the reported number of CPUs fluctuate.

So using the number of CPUs that are online *right now* does not seem
appropriate, because on an otherwise idle system a just-started application
will see just one CPU as online.

Alexander


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