From mboxrd@z Thu Jan 1 00:00:00 1970 From: paulmck@linux.vnet.ibm.com (Paul E. McKenney) Date: Wed, 21 Sep 2011 16:43:25 -0700 Subject: [ltt-dev] [URCU PATCH] cmm: provide lightweight rmb/wmb on PPC In-Reply-To: <4E799028.1010707@redhat.com> References: <1316502769-576-1-git-send-email-pbonzini@redhat.com> <20110920163125.GA31802@Krystal> <4E78C1C5.2080001@redhat.com> <20110920165115.GA2955@Krystal> <4E799028.1010707@redhat.com> Message-ID: <20110921234325.GH2394@linux.vnet.ibm.com> On Wed, Sep 21, 2011 at 09:20:08AM +0200, Paolo Bonzini wrote: > On 09/20/2011 06:51 PM, Mathieu Desnoyers wrote: > >>> I think you're right. "eieio;lwsync" is good for rmb, lwsync is good for > >>> wmb/smp_rmb/smp_wmb. > >I'm not convinced that the "eieio; lwsync" combo would provide the > >ordering we're looking for for cmm_rmb(). AFAIK, eieio orders, > >separately, a) cacheable stores and b) loads and stores to non-cacheable > >memory. AFAIK, lwsync orders cacheable memory ops, but not loads with > >respect to previous stores. So basically, this combo lacks ordering of > >non-cacheable memory accesses with respect to cachable memory accesses. > > Yeah, better safe than sorry. > > >Why would lwsync be good for cmm_wmb ? Does it order non-cacheable > >writes ? > > The manuals say non-cacheable writes are always ordered. But at best only against other non-cacheable writes. Again, they can slip out of lock-based critical sections. Thanx, Paul