Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks

From: Paul E. McKenney
Date: Fri Jun 22 2018 - 16:51:32 EST


On Fri, Jun 22, 2018 at 03:11:37PM -0400, Alan Stern wrote:
> On Fri, 22 Jun 2018, Will Deacon wrote:
> > On Fri, Jun 22, 2018 at 02:09:04PM -0400, Alan Stern wrote:

[ . . . ]

> > > > Could we drop the acquire/release stuff from the patch and limit this change
> > > > to locking instead?
> > >
> > > The LKMM uses the same CAT code for acquire/release and lock/unlock.
> > > (In essence, it considers a lock to be an acquire and an unlock to be a
> > > release; everything else follows from that.) Treating one differently
> > > from the other in these tests would require some significant changes.
> > > It wouldn't be easy.
> >
> > It would be boring if it was easy ;) I think this is a case of the tail
> > wagging the dog.
> >
> > Paul -- please can you drop this patch until we've resolved this discussion?
>
> Agreed. It sounds like we'll need two versions of the Rel and Acq sets
> in the memory model; one for RCpc and one for RCsc. smp_load_acquire
> and smp_store_release will use the former, and locking will use the
> latter.

Done!

Thanx, Paul

> Would it suffice to have this duplication just for release, using a
> single version of acquire? What would happen on ARMv8 or RISC-V if an
> RCsc release was read by an RCpc acquire? Or vice versa?
>
> Alan
>