[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1259228139.4273.6.camel@twins>
Date: Thu, 26 Nov 2009 10:35:39 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Mike Galbraith <efault@....de>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [patch] sched: fix set_task_cpu() and provide an unlocked
runqueue variant
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.
> 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).
--
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