[ltt-dev] [URCU PATCH] cmm: provide lightweight rmb/wmb on PPC

Paul E. McKenney paulmck at linux.vnet.ibm.com
Wed Sep 21 19:42:42 EDT 2011


On Tue, Sep 20, 2011 at 06:39:33PM +0200, Paolo Bonzini wrote:
> On 09/20/2011 06:31 PM, Mathieu Desnoyers wrote:
> >I don't think lwsync orders non-cacheable memory operations. Therefore,
> >is it the right choice for cmm_rmb/cmm_wmb ?
> 
> I think you're right. "eieio;lwsync" is good for rmb, lwsync is good
> for wmb/smp_rmb/smp_wmb.

But eieio;lwsync won't order non-cacheable memory operations against
cacheable memory operations.  This means that your MMIO accesses can
slip out of your lock-based critical section, which is a very bad
thing indeed.

For general-purpose use, I strongly recommend full "sync" for mb(),
rmb(), and wmb().  For memory-only use, the developer should not
be using these, but smp_mb(), smp_rmb(), and smp_wmb() instead.

							Thanx, Paul




More information about the lttng-dev mailing list