This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] sched_getaffinity() fails with -EINVAL
- From: Ulrich Drepper <drepper at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 04 Mar 2010 21:41:13 -0800
- Subject: Re: [PATCH] sched_getaffinity() fails with -EINVAL
- References: <4B7D30C6.8060702@in.ibm.com> <4B7D8565.6010603@redhat.com> <20100219113708.B94D.A69D9226@jp.fujitsu.com> <4B7EB1BC.9010604@in.ibm.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 02/19/2010 07:43 AM, Sharyathi Nagesh wrote:
> Kosaki I am not completely convinced how we can suggest changes to
> kernel code. Meanwhile changing the interfaces to *_S macros looks more
> appropriate
The kernel, for the slim probability that somebody uses hotplug CPUs and
increases the number of CPUs, always checks the maximum number of
configured CPUs fits in the cpu set.
An alternative would be to always just test the number of configured
CPUs at the time of the call. This is backward compatible and wouldn't
hurt most people even with a maximum of 2048 CPUs.
Only if the bitset is really too small would we get errors.
The only problem is what to do if the number of online CPUs increases.I
think defaulting to off is just as valid a solution as accepting info in
setaffinity calls for CPUs which are unknown at the time of the call.
- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkuQmXkACgkQ2ijCOnn/RHTspACgxqybNK6gI5uMDWFSipZ6wBVM
mj0AnR++CF76EUckMPAyyPSyQiSLaP7w
=zaWc
-----END PGP SIGNATURE-----