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: [PATCH] glibc: Remove CPU set size checking from affinity functions [BZ #19143]


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


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