* [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
@ 2009-07-27 17:16 Gregory Haskins
2009-07-27 17:35 ` Steven Rostedt
2009-07-27 18:12 ` David Rientjes
0 siblings, 2 replies; 6+ messages in thread
From: Gregory Haskins @ 2009-07-27 17:16 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org; +Cc: Steven Rostedt
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
I am not sure when this started, but noticed that sched_getaffinity is
not working in -rc4.
[pid 6254] sched_getaffinity(0, 128, 0x7f80586b1fe0) = -1 EINVAL
(Invalid argument)
Here is a simple program for reproduction:
#include <sched.h>
int main(void)
{
cpu_set_t mask;
int ret;
ret = sched_getaffinity(0, sizeof(mask), &mask);
if (ret < 0)
perror("getaffinity");
return ret;
}
If I get time, I will bisect this later today.
Regards,
-Greg
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 267 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
2009-07-27 17:16 [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4 Gregory Haskins
@ 2009-07-27 17:35 ` Steven Rostedt
2009-07-27 18:12 ` David Rientjes
1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-07-27 17:35 UTC (permalink / raw)
To: Gregory Haskins
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner, Peter Zijlstra,
Ingo Molnar
On Mon, 27 Jul 2009, Gregory Haskins wrote:
> I am not sure when this started, but noticed that sched_getaffinity is
> not working in -rc4.
>
> [pid 6254] sched_getaffinity(0, 128, 0x7f80586b1fe0) = -1 EINVAL
> (Invalid argument)
>
> Here is a simple program for reproduction:
Thanks,
I have a box available in which I can look at this further.
-- Steve
>
> #include <sched.h>
>
> int main(void)
> {
> cpu_set_t mask;
> int ret;
>
> ret = sched_getaffinity(0, sizeof(mask), &mask);
> if (ret < 0)
> perror("getaffinity");
>
> return ret;
> }
>
> If I get time, I will bisect this later today.
>
> Regards,
> -Greg
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
2009-07-27 17:16 [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4 Gregory Haskins
2009-07-27 17:35 ` Steven Rostedt
@ 2009-07-27 18:12 ` David Rientjes
2009-07-29 1:48 ` Rusty Russell
1 sibling, 1 reply; 6+ messages in thread
From: David Rientjes @ 2009-07-27 18:12 UTC (permalink / raw)
To: Gregory Haskins; +Cc: linux-kernel, Steven Rostedt, Rusty Russell
On Mon, 27 Jul 2009, Gregory Haskins wrote:
> I am not sure when this started, but noticed that sched_getaffinity is
> not working in -rc4.
>
> [pid 6254] sched_getaffinity(0, 128, 0x7f80586b1fe0) = -1 EINVAL
> (Invalid argument)
>
> Here is a simple program for reproduction:
>
> #include <sched.h>
>
> int main(void)
> {
> cpu_set_t mask;
> int ret;
>
> ret = sched_getaffinity(0, sizeof(mask), &mask);
> if (ret < 0)
> perror("getaffinity");
>
> return ret;
> }
>
> If I get time, I will bisect this later today.
>
It's most likely due to the cpumask changes. I don't know what cpu_set_t
is, but it's probably smaller than CONFIG_NR_CPUS rounded up to a multiple
of sizeof(long).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
2009-07-27 18:12 ` David Rientjes
@ 2009-07-29 1:48 ` Rusty Russell
2009-07-29 3:30 ` David Rientjes
2009-07-29 3:48 ` Gregory Haskins
0 siblings, 2 replies; 6+ messages in thread
From: Rusty Russell @ 2009-07-29 1:48 UTC (permalink / raw)
To: David Rientjes; +Cc: Gregory Haskins, linux-kernel, Steven Rostedt, Ingo Molnar
On Tue, 28 Jul 2009 03:42:15 am David Rientjes wrote:
> On Mon, 27 Jul 2009, Gregory Haskins wrote:
>
> > I am not sure when this started, but noticed that sched_getaffinity is
> > not working in -rc4.
> >
> > [pid 6254] sched_getaffinity(0, 128, 0x7f80586b1fe0) = -1 EINVAL
> > (Invalid argument)
> >
> > Here is a simple program for reproduction:
> >
> > #include <sched.h>
> >
> > int main(void)
> > {
> > cpu_set_t mask;
> > int ret;
> >
> > ret = sched_getaffinity(0, sizeof(mask), &mask);
> > if (ret < 0)
> > perror("getaffinity");
> >
> > return ret;
> > }
> >
> > If I get time, I will bisect this later today.
> >
>
> It's most likely due to the cpumask changes. I don't know what cpu_set_t
> is, but it's probably smaller than CONFIG_NR_CPUS rounded up to a multiple
> of sizeof(long).
It's simply that you finally ran this on a kernel which had
CONFIG_NR_CPUS > 1024.
I argued strongly against the set and getaffinity interfaces when they were
introduced; they can't be used in general without a loop (enlarge cpu_set,
retry).
Cheers,
Rusty.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
2009-07-29 1:48 ` Rusty Russell
@ 2009-07-29 3:30 ` David Rientjes
2009-07-29 3:48 ` Gregory Haskins
1 sibling, 0 replies; 6+ messages in thread
From: David Rientjes @ 2009-07-29 3:30 UTC (permalink / raw)
To: Rusty Russell; +Cc: Gregory Haskins, linux-kernel, Steven Rostedt, Ingo Molnar
On Wed, 29 Jul 2009, Rusty Russell wrote:
> I argued strongly against the set and getaffinity interfaces when they were
> introduced; they can't be used in general without a loop (enlarge cpu_set,
> retry).
>
Right, so the functional regression here is glibc 2.3.2 -> 2.3.3.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
2009-07-29 1:48 ` Rusty Russell
2009-07-29 3:30 ` David Rientjes
@ 2009-07-29 3:48 ` Gregory Haskins
1 sibling, 0 replies; 6+ messages in thread
From: Gregory Haskins @ 2009-07-29 3:48 UTC (permalink / raw)
To: Rusty Russell; +Cc: David Rientjes, linux-kernel, Steven Rostedt, Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
Rusty Russell wrote:
> On Tue, 28 Jul 2009 03:42:15 am David Rientjes wrote:
>> On Mon, 27 Jul 2009, Gregory Haskins wrote:
>>
>>> I am not sure when this started, but noticed that sched_getaffinity is
>>> not working in -rc4.
>>>
>>> [pid 6254] sched_getaffinity(0, 128, 0x7f80586b1fe0) = -1 EINVAL
>>> (Invalid argument)
>>>
>>> Here is a simple program for reproduction:
>>>
>>> #include <sched.h>
>>>
>>> int main(void)
>>> {
>>> cpu_set_t mask;
>>> int ret;
>>>
>>> ret = sched_getaffinity(0, sizeof(mask), &mask);
>>> if (ret < 0)
>>> perror("getaffinity");
>>>
>>> return ret;
>>> }
>>>
>>> If I get time, I will bisect this later today.
>>>
>> It's most likely due to the cpumask changes. I don't know what cpu_set_t
>> is, but it's probably smaller than CONFIG_NR_CPUS rounded up to a multiple
>> of sizeof(long).
>
> It's simply that you finally ran this on a kernel which had
> CONFIG_NR_CPUS > 1024.
Indeed. I thought I had replied to the list that I figured that out,
but I think it might have been a trimmed list from someone elses reply.
Long story short, MAXSMP=y crept in, which set NR_CPUS=4096. Backing
this off < 1024 indeed fixes the issue.
Thanks to all who replied!
-Greg
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 267 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-29 3:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 17:16 [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4 Gregory Haskins
2009-07-27 17:35 ` Steven Rostedt
2009-07-27 18:12 ` David Rientjes
2009-07-29 1:48 ` Rusty Russell
2009-07-29 3:30 ` David Rientjes
2009-07-29 3:48 ` Gregory Haskins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox