This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] glibc: Remove CPU set size checking from affinity functions [BZ #19143]
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 10 Mar 2016 12:20:37 +0100
- Subject: Re: [PATCH] glibc: Remove CPU set size checking from affinity functions [BZ #19143]
- Authentication-results: sourceware.org; auth=none
- References: <5621126E dot 5080801 at redhat dot com> <56252723 dot 6010407 at redhat dot com> <562A3D82 dot 5010907 at redhat dot com> <563A67D3 dot 5070306 at redhat dot com> <565492BA dot 2030006 at redhat dot com> <CALxWeYqvcgRMmsY7NAROpcHjywtsvEXynTN0ZrqKgdH40g0FUw at mail dot gmail dot com> <56DEB4D3 dot 6020202 at redhat dot com> <56DF2B0C dot 402 at gmail dot com>
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