Re: [RFC][PATCH]: documentation,atomic: Add a new atomic_t document

From: Boqun Feng
Date: Sun Jun 11 2017 - 09:55:01 EST


Hi Peter,

On Fri, Jun 09, 2017 at 09:36:04PM +0200, Peter Zijlstra wrote:
[...]
> > > +Ordering: (go read memory-barriers.txt first)
> > > +
> > > +The rule of thumb:
> > > +
> > > + - non-RmW operations are unordered;
> > > +
> > > + - RmW operations that have no return value are unordered;
> > > +
> > > + - RmW operations that have a return value are Sequentially Consistent;
> >
> > I think it's stronger than that, because they also order non-RmW operations,
> > whereas this makes it sounds like there's just a total order over all RmW
> > operations.
>
> Right, what should I call it?
>

I think the term we use to refer this behavior is "fully-ordered"? Could
we give it a slight formal definition like:

a. memory operations preceding and following the RmW operation is
Sequentially Consistent.

b. load or store part of the RmW operation is Sequentially
Consistent with operations preceding or following.

Though, sounds like defining "fully-ordered" is the job for
memory-barriers.txt, but it's never done ;-)

Regards,
Boqun



> > > + - RmW operations that are conditional are unordered on FAILURE, otherwise the
> > > + above rules apply.
> >

Attachment: signature.asc
Description: PGP signature