From: Mike Galbraith <efault@gmx.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch] sched: fix set_task_cpu() and provide an unlocked runqueue variant
Date: Thu, 26 Nov 2009 11:16:18 +0100 [thread overview]
Message-ID: <1259230578.15079.12.camel@marge.simson.net> (raw)
In-Reply-To: <1259228139.4273.6.camel@twins>
On Thu, 2009-11-26 at 10:35 +0100, Peter Zijlstra wrote:
> On Thu, 2009-11-26 at 02:31 +0100, Mike Galbraith wrote:
> > On Thu, 2009-11-26 at 02:01 +0100, Mike Galbraith wrote:
> > > On Wed, 2009-11-25 at 19:27 +0100, Peter Zijlstra wrote:
> >
> > > > I've got to ask, what's that barrier for?
> > >
> > > It's a leftover from frustrated bug hunting.
> >
> > To be more specific, I put it there to ensure that min_vruntimes are
> > stable.
>
> min_vruntime should only ever be poked at when holding the respective
> rq->lock, even with a barrier a 64bit read on a 32bit machine can go all
> funny.
Yeah, but we're looking at an unlocked runqueue. But never mind...
> > I figured that if try_to_wake_up() needs a barrier to look at
> > task->state, I had better do the same for the runqueues.
>
> Ah, ttwu() has that barrier for another reason. The wmb in ttwu() is to
> ensure the wakee sees the state of the waker at the time of waking.
>
> That is, its about ordering things like:
>
>
> A B
>
>
> my_cond = true;
> wake_process(my_friend);
>
> while (!my_cond)
> schedule();
>
>
> So that you can actually observe my_cond being true once you wakeup
> (schedule acts as a mb() when it actually schedules).
(Ah! I think you actually made a wrinkle in grey-ware)
...ATM, I kinda wish I'd not gone off and read barriers.txt. It hasn't
sunk in yet, but certainly has made me _paranoid as hell_ :-)
-Mike
next prev parent reply other threads:[~2009-11-26 10:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-22 12:09 [patch] sched: fix set_task_cpu() and provide an unlocked runqueue variant Mike Galbraith
2009-11-25 18:27 ` Peter Zijlstra
2009-11-26 1:01 ` Mike Galbraith
2009-11-26 1:31 ` Mike Galbraith
2009-11-26 9:35 ` Peter Zijlstra
2009-11-26 10:16 ` Mike Galbraith [this message]
2009-11-26 14:09 ` Peter Zijlstra
2009-11-26 14:21 ` Peter Zijlstra
2009-11-26 15:32 ` Mike Galbraith
2009-11-26 14:58 ` Mike Galbraith
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=1259230578.15079.12.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.