From: Rusty Russell <rusty@rustcorp.com.au>
To: David Rientjes <rientjes@google.com>
Cc: Gregory Haskins <gregory.haskins@gmail.com>,
linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [regression] sched_getaffinity fails with EINVAL in 2.6.31-rc4
Date: Wed, 29 Jul 2009 11:18:53 +0930 [thread overview]
Message-ID: <200907291118.53912.rusty@rustcorp.com.au> (raw)
In-Reply-To: <alpine.DEB.2.00.0907271108350.8408@chino.kir.corp.google.com>
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.
next prev parent reply other threads:[~2009-07-29 1:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2009-07-29 3:30 ` David Rientjes
2009-07-29 3:48 ` Gregory Haskins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907291118.53912.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=gregory.haskins@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox