Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire

From: Andrea Parri
Date: Thu Jul 12 2018 - 17:24:03 EST


On Thu, Jul 12, 2018 at 11:13:48PM +0200, Andrea Parri wrote:
> On Thu, Jul 12, 2018 at 04:43:46PM -0400, Alan Stern wrote:
> > On Thu, 12 Jul 2018, Andrea Parri wrote:
> >
> > > > It seems reasonable to ask people to learn that locks have stronger
> > > > ordering guarantees than RMW atomics do. Maybe not the greatest
> > > > situation in the world, but one I think we could live with.
> > >
> > > Yeah, this was one of my main objections.
> >
> > Does this mean you don't think you could live with it?
>
> Well, I *could* leave with it and with RCtso locks, ;-) but I'd rather not.
>
> Assuming that I will not be able to resist this RCtso trend, ;-) would the
> below (completely untested) work?
>
> let rmw = rmw | lk-rmw (* from lock.cat *)
> let po-unlock-rf-lock-po = po ; [Release] ; rf ; [domain(rmw)] ; po

domain(rmw) & Acquire, maybe...

Andrea


> [the rest of your patch + the updates to the doc. I suggested in v2 ;-)]
>
> Andrea