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 Tue, Jul 16, 2013 at 7:04 AM,  <chrubis@suse.cz> wrote:
> Hi!
>> /sys/devices/system/cpu/possible returns possible cpu mask. AFAIK, unfortunately,
>> sysconf() doesn't support to get possible cpus.
>
> There is _SC_NPROCESSORS_CONF and get_nprocs_conf() that counts number
> of directories with cpu prefix in '/sys/devices/system/'.

They are not exactly match, AFAIK. /sys/devices/system can be changed
dynamically if the hardware
have a real hotplug support. But /sys/devices/system/cpu/possible
never be changed.

/sys/devices/system mean current _recognized_ cpus by kernel. (both
online and offline). It mean
logical cpu offlining (uses echo 0 >
/sys/devices/system/cpu/cpuX/online) doesn't change the directory.
But physical hotplug (only equipped by IBM, HP and Fujitsu high end
machine) may change.


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