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

From: Peter Zijlstra
Date: Thu Jan 21 2010 - 06:28:18 EST

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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at