Messages in this thread | | | Subject | Re: [patch 2/3] scheduler: add full memory barriers upon task switch at runqueue lock/unlock | From | Steven Rostedt <> | Date | Mon, 01 Feb 2010 11:46:35 -0500 |
| |
[ Added linux-arch ]
On Mon, 2010-02-01 at 17:29 +0100, Peter Zijlstra wrote: > On Mon, 2010-02-01 at 11:24 -0500, Steven Rostedt wrote: > > > > Doesn't set_bit imply a wmb()? If so couldn't we do: > > Nope, that's what we have smp_mb__{before,after}_set_bit() for. > > On x86 its a LOCK'ed op, so sure it implies a full membarrier, but not > in generic. > > on x86 we have plenty serializing instructions before and after rq->curr > is set so none of the crazyness is needed at all. The only thing is ! > x86. >
So if we go with Linus's approach and make all archs guarantee that switch_mm() implies a full mb(), then we can simplify the sys_membarrier() code?
That looks like the best approach.
-- Steve
| |