[PATCH] glibc: Remove CPU set size checking from affinity functions [BZ #19143]
Florian Weimer
fweimer@redhat.com
Thu Mar 10 11:20:00 GMT 2016
On 03/08/2016 08:42 PM, Michael Kerrisk (man-pages) wrote:
>> One caveat is that sched_getaffinity can set bits beyond the requested
>> allocation size (in bits) because the kernel gets a padded CPU vector
>> and sees a few additional bits.
>
> I'm not quite clear on this point. Does it get a padded CPU vector
> because CPU_ALLOC() might allocate a vector of size larger than the
> user requested?
Yes, this is the problem, combined with CPU_ALLOC_SIZE returning the
larger size (which is unavoidable).
This whole interface could have been designed much better (compare
select to epoll, for instance).
Florian
More information about the Libc-alpha
mailing list