On Fri, Nov 22, 2013 at 10:49 AM, Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx> wrote: > > You see, my problem is not the "crazy ordering" DEC Alpha, Itanium, > PowerPC, or even ARM. It is really obvious what instructions to use in > a stiffened-up smp_store_release() for those guys: "mb" for DEC Alpha, > "st.rel" for Itanium, "sync" for PowerPC, and "dmb" for ARM. Believe it > or not, my problem is instead with good old tightly ordered x86. > > We -could- just put an mfence into x86's smp_store_release() and > be done with it Why would you bother? The *acquire* has a memory barrier. End of story. On x86, it has to (since otherwise a load inside the locked region could be re-ordered wrt the write that takes the lock). Basically, any time you think you need to add a memory barrier on x86, you should go "I'm doing something wrong". It's that simple. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>