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 <fw at deneb dot enyo dot de>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: cgroups at vger dot kernel dot org, kosaki dot motohiro at gmail dot com, Linux API <linux-api at vger dot kernel dot org>, Li Zefan <lizefan at huawei dot com>
- Date: Sat, 17 Oct 2015 07:48:06 +0200
- 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> <20151017031003 dot GE28215 at vapier dot lan>
* Mike Frysinger:
> On 16 Oct 2015 17:06, Florian Weimer wrote:
>> The current situation, briefly stated, is this: glibc tries to guess the
>> kernel CPU set size and rejects attempts to specify an affinity mask
>> which is larger than that, but it does not work, and glibc and the
>> kernel still silently accept CPU affinity masks with invalid bits,
>> without returning an error. The glibc check does not provide any value
>> to applications, it just adds pointless complexity to the library.
>> Therefore, I want to remove it from glibc.
>
> checking the validty of the cpuset mask at the time of setting attributes
> seems fundamentally wrong to me. can't the cpuset change too between the
> check and the actual use ?
Yes, unfortunately, that could happen. There are algorithms that
would benefit if the affinity mask could not be changed from outside
the process.
> patch makes sense to me
>
>> + abort ();
>
> why does the test call abort instead of exit ?
It would have to be _exit, because otherwise, the remaining running
threads would block exiting.
> abort writes to stderr.
I don't think so, âAbortedâ is printed by the shell.