This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- Cc: chrubis at suse dot cz, libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 18 Jul 2013 18:15:56 -0400
- Subject: Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- References: <51E42BFE dot 7000301 at redhat dot com> <51E4A0BB dot 2070802 at gmail dot com> <20130716110445 dot GA20826 at rei> <CAHGf_=qxR-abdjwmJUw8vApSioDhKhvsc54Yx-fpw5V-whpioQ at mail dot gmail dot com> <51E5DCB2 dot 1070305 at gmail dot com> <20130717100527 dot GA24881 at rei> <51E6EA7E dot 6050601 at gmail dot com> <20130718110505 dot GA32439 at rei> <51E85763 dot 5090809 at gmail dot com>
On 07/18/2013 05:00 PM, KOSAKI Motohiro wrote:
>> Now we only need to figure out what exactly it does and make that into
>> understandable wording.
>
> btw, I have an another question. the manual says _SC_NPROCESSORS_CONF could
> be used maximum parallelism performance. But I don't understand why number of
> configured cpus help it.
>
> Example, if an administrator has found a cpu problem in firmware log and he
> disable one of cpus, and current status is folloing:
>
> present cpus: 0-7
> online cpus: 0-6
>
> Why application should think the cpus are 8? I mean cpu offlining is typically
> not short term. And as I already said it doesn't work correct if cpu is hot added
> dynamically. I'm not sure who and when should use this.
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.
Cheers,
Carlos.