public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Αλέξανδρος Παπαδογιαννάκης" <psxlover@hotmail.com>
Cc: <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: FW: sched_setaffinity not working with kernel 2.6.32.15
Date: Tue, 22 Jun 2010 17:16:22 -0700	[thread overview]
Message-ID: <20100622171622.fc9d04c1.akpm@linux-foundation.org> (raw)
In-Reply-To: <COL124-W1850C30E9FF3BFB06DF5BFD6C20@phx.gbl>

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.

> ...

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.


  reply	other threads:[~2010-06-23  0:17 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 [this message]
2010-06-23  7:19   ` Peter Zijlstra
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=20100622171622.fc9d04c1.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --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