On Wed, Nov 20, 2013 at 09:14:00AM -0800, Paul E. McKenney wrote: > > Hmm, so in the following case: > > > > Access A > > unlock() /* release semantics */ > > lock() /* acquire semantics */ > > Access B > > > > A cannot pass beyond the unlock() and B cannot pass the before the lock(). > > > > I agree that accesses between the unlock and the lock can be move across both > > A and B, but that doesn't seem to matter by my reading of the above. > > > > What is the problematic scenario you have in mind? Are you thinking of the > > lock() moving before the unlock()? That's only permitted by RCpc afaiu, > > which I don't think any architectures supported by Linux implement... > > (ARMv8 acquire/release is RCsc). > > If smp_load_acquire() and smp_store_release() are both implemented using > lwsync on powerpc, and if Access A is a store and Access B is a load, > then Access A and Access B can be reordered. > > Of course, if every other architecture will be providing RCsc implementations > for smp_load_acquire() and smp_store_release(), which would not be a bad > thing, then another approach is for powerpc to use sync rather than lwsync > for one or the other of smp_load_acquire() or smp_store_release(). So which of the two would make most sense? As per the Document, loads/stores should not be able to pass up through an ACQUIRE and loads/stores should not be able to pass down through a RELEASE. I think PPC would match that if we use sync for smp_store_release() such that it will flush the store buffer, and thereby guarantee all stores are kept within the required section. -- 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>