Re: [RFC PATCH] introduce sys_membarrier(): process-wide memory barrier (v5)

Peter Zijlstra
2010-01-21T11:28:13Z

On Tue, 2010-01-19 at 20:06 +0100, Peter Zijlstra wrote:
>
> We could possibly look at placing that assignment in context_switch()
> between switch_mm() and switch_to(), which should provide a mb before
> and after I think, Ingo?

Right, just found out why we cannot do that, the first thing
context_switch() does is prepare_context_switch() which includes
prepare_lock_switch() which on __ARCH_WANT_UNLOCKED_CTXSW machines drops
the rq->lock, and we have to have rq->curr assigned by then.