Re: [PATCH -tip] introduce sys_membarrier(): process-wide memorybarrier (v9)

From: Josh Triplett
Date: Tue Mar 02 2010 - 12:57:49 EST

On Thu, Feb 25, 2010 at 06:23:16PM -0500, Mathieu Desnoyers wrote:
> I am proposing this patch for the 2.6.34 merge window, as I think it is ready
> for inclusion.
> Here is an implementation of a new system call, sys_membarrier(), which
> executes a memory barrier on all threads of the current process.

> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Acked-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
> Acked-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
> CC: Nicholas Miell <nmiell@xxxxxxxxxxx>
> CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> CC: mingo@xxxxxxx
> CC: laijs@xxxxxxxxxxxxxx
> CC: dipankar@xxxxxxxxxx
> CC: akpm@xxxxxxxxxxxxxxxxxxxx
> CC: josh@xxxxxxxxxxxxxxxx

Acked-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>

I agree that v9 seems ready for inclusion.

Out of curiosity, do you have any benchmarks for the case of not
detecting sys_membarrier dynamically? Detecting it at library
initialization time, for instance, or even just compiling to assume its
presence? I'd like to know how much that would improve the numbers.

If significant, it might make sense to try to have a mechanism similar
to SMP alternatives, to have different code in either case. dlopen,
function pointers, runtime code patching (nop out the rmb), or similar.

- Josh Triplett
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