Re: [PATCH 3/4] x86,asm: Re-work smp_store_mb()

From: Linus Torvalds
Date: Tue Jan 12 2016 - 18:24:10 EST


On Tue, Jan 12, 2016 at 2:55 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> Be careful with this: if it only shows up in a microbenchmark, we may
> introduce a hard-to-debug regression for no real benefit.

So I can pretty much guarantee that it shouldn't regress from a
correctness angle, since we rely *heavily* on locked instructions
being barriers, in locking and in various other situations.

Indeed, much more so than we ever rely on "smp_mb()". The places that
rely on smp_mb() are pretty few in the end.

So I think the only issue is whether sometimes "mfence" might be
faster. So far, I've never actually heard of that being the case. The
fence instructions have always sucked when I've seen them.

But talking to the hw people about this is certainly a good idea regardless.

Linus