From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Αλέξανδρος Παπαδογιαννάκης" <psxlover@hotmail.com>,
linux-kernel@vger.kernel.org, "Ingo Molnar" <mingo@elte.hu>
Subject: Re: FW: sched_setaffinity not working with kernel 2.6.32.15
Date: Wed, 23 Jun 2010 09:19:17 +0200 [thread overview]
Message-ID: <1277277558.1875.745.camel@laptop> (raw)
In-Reply-To: <20100622171622.fc9d04c1.akpm@linux-foundation.org>
On Tue, 2010-06-22 at 17:16 -0700, Andrew Morton wrote:
> On Sun, 20 Jun 2010 22:10:18 +0300
> ____________________ ______________________________ <psxlover@hotmail.com> wrote:
>
> >
> > From: psxlover@hotmail.com
> > To: mingo@elte.hu; peterz@infradead.org
> > Subject:
> > sched_setaffinity not working with kernel 2.6.32.15
> > Date: Sun, 20
> > Jun 2010 17:14:12 +0300
>
> I assume from this that you initially sent the email privately to
> Peter&Ingo, then forwarded it to the list without cc'ing Peter&Ingo.
> So if they're already responded to the inital email, I'm wasting my
> time. Ho hum.
My private copy seems to have gone missing..
> > ...
>
> That's a great bug report - fully bisected and it includes a testcase.
> Thanks.
>
> However I think your testcase is buggy. You have main() racing against
> print_affinity(). If a sub-thread runs print_affinity() before main()
> has run set_threadaffinity(), print_affinity() will obviously print
> main()'s affinity.
>
> Between 2.6.18 and 2.6.35-rc3 the timing changed a bit - in the later
> kernel the sub-threads are running before main() is able to change
> their affinity. In the earlier kernel the sub-threads run first.
>
> In both kernels, all CPU consumption is on CPU 0 as desired.
>
> Re-enabling the sleep(1) in threadCode() fixes the print_affinity()
> output, confirming that it's a userspace race.
Andrew is right, your program is buggy.
next prev parent reply other threads:[~2010-06-23 7:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-20 19:10 FW: sched_setaffinity not working with kernel 2.6.32.15 Αλέξανδρος Παπαδογιαννάκης
2010-06-23 0:16 ` Andrew Morton
2010-06-23 7:19 ` Peter Zijlstra [this message]
2010-06-25 10:19 ` Αλέξανδρος Παπαδογιαννάκης
2010-06-23 7:20 ` Αλέξανδρος Παπαδογιαννάκης
2010-06-23 7:25 ` Αλέξανδρος Παπαδογιαννάκης
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=1277277558.1875.745.camel@laptop \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=psxlover@hotmail.com \
/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