[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1277277558.1875.745.camel@laptop>
Date: Wed, 23 Jun 2010 09:19:17 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Αλέξανδρος Παπαδογιαννάκης <psxlover@...mail.com>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>
Subject: Re: FW: sched_setaffinity not working with kernel 2.6.32.15
On Tue, 2010-06-22 at 17:16 -0700, Andrew Morton wrote:
> On Sun, 20 Jun 2010 22:10:18 +0300
> ____________________ ______________________________ <psxlover@...mail.com> wrote:
>
> >
> > From: psxlover@...mail.com
> > To: mingo@...e.hu; peterz@...radead.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists