Re: [PATCH tip/core/rcu 3/4] documentation: Add acquire/release barriers to pairing rules

From: Peter Zijlstra
Date: Tue Jul 08 2014 - 03:59:19 EST


On Mon, Jul 07, 2014 at 03:24:21PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
>
> It is possible to pair acquire and release barriers with other barriers,
> so this commit adds them to the list in the SMP barrier pairing section.
>
> Reported-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Tejun Heo <tj@xxxxxxxxxx>


> +A write barrier should always be paired with a data dependency barrier,
> +acquire barrier, release barrier, or read barrier, though a general
> +barrier would also be viable.

Similarly a read barrier or a data
> +dependency barrier should always be paired with at least a write barrier,
> +an acquire barrier, or a release barrier, though, again, a general
> +barrier is viable:

When I first read the Changelog I though you were going to add things
like:

An acquire barrier should be paired with a release barrier, however
.... barrier is also viable.

A release barrier should be paired with an acquire barrier,... etc.

Now the above does seem to imply such rules but it isn't explicit in
them, since it only lists the requirements for read/write. Now since the
entire thing is indeed symmetric the implications are fairly strong,
still.

Also, it might be good to have a section on the ramifications of pairing
acquire/release with other than themselves, I have the feeling there's
subtle things there.

Attachment: pgpbGypy4JLHC.pgp
Description: PGP signature