On Mon, Jan 23, 2023 at 02:59:37PM +0100, Jonas Oberhauser wrote:
Only in that such a memory barrier would order po-earlier anything
On 1/21/2023 9:56 PM, Alan Stern wrote:
There is yet another level of fences in the hierarchy: those which orderHm, so could we say some fences order
instruction execution but not propagation (smp_rmb() and acquire). One
of the important points about cumul-fence is that it excludes this
level.
That's for a functional reason -- prop simply doesn't work for those
fences, so it has to exclude them. But it does work for strong fences,
so excluding them would be an artificial restriction.
1) propagation with propagation (weak fences)
2) execution with execution (rmb, acquire)
3) propagation with execution (strong fences)
where ordering with execution implicitly orders with propagation as well
because things can only propagate after they execute.
However, the 4th possibility (execution with only propagation) happens not
to exist. I'm not sure if it would even be distinguishable from the second
type.
against po-later stores, whereas rmb orders loads against loads and
acquire orders loads against anything.
In the operational model, can you forward from stores that have notYes, it is explicitly allowed. But forwarding doesn't apply in this
executed yet?
situation because stores can be forwarded only to po-later loads, not to
po-earlier ones.
Not if Y is a load.Not quite right. A hypothetical non-A-cumulative case for pb would haveWouldn't that violate the transitivity of "X is required to propagate before
to omit the cumul-fence term entirely.
Y" ?
If I have
X ->cumul-fence+ Y ->weird-strong-fence Z
doesn't that mean that for every CPU C,
1. X is required to propagate to C before Y propagates to C
2. Y is required to propagate to C before any instruction po-after Z
executes
I guess one would have to put
(cumul-fence+ ; [W])?
or something like it in the definition.
Thinking about prop and pb along these lines gives me a weird feeling.I think the reason it got left out was because all strong fences are
Trying to pinpoint it down, it seems a little bit weird that A-cumul doesn't
appear around the strong-fence in pb.
A-cumulative. If some of them weren't, it would have to appear there in
some form.
Of course it should not appear afterIsn't this just a more complicated way of saying what the A-cumul()
prop which already has an rfe? at the end. Nevertheless, having the rfe? at
the end is clearly important to representing the idea behind prop. If it
weren't for the fact that A-cumul is needed to define prop, it almost makes
me think that it would be nice to express the difference between
A-cumulative and non-A-cumulative fences (that order propagation) by saying
that an A-cumulative fence has
prop ; a-cumul-fence;rfe? <= prop
while the non-A-cumulative fence has
prop-without-rfe ; non-a-cumul-fence <= prop-without-rfe
macro expresses?
I'm not against this partially overlapping kind of redundancy, but I dislikeConsider: Could we remove all propagation-ordering fences from ppo
subsuming kind of redundancy where some branches of the logic just never
need to be used.
because they are subsumed by prop? (Or is that just wrong?)
I think that's an improvement. It's obvious that (hb | pb)* is right and so is (pb | hb)*.I'm not so sure that's a good idea. For instance, it would require theIn fact, I wouldn't mind removing the happens-before, propagation, andI was planning to propose the same thing, however, I would also propose to
rcu axioms from LKMM entirely, replacing them with the single
executes-before axiom.
redefine hb and rb by dropping the hb/pb parts at the end of these
relations.
hb = ....
pb = prop ; strong-fence ; [Marked]
rb = prop ; rcu-fence ; [Marked]
xb = hb|pb|rb
acyclic xb
definitions of rcu-link and rb to be changed from having (hb* ; pb*) to
having (hb | pb)*.
Also, although it's not mentioned anywhere, the
definition of xbstar could be changed to hb* ; pb* ; rb* because each of
these relations absorbs a weaker one to its right.
Sure, go ahead.Perhaps we can start a new thread then to discuss a few points whereI'm wondering a little if there's some way in the middle, e.g., by writtingI have no objection to doing that. It seems like a good idea.
short comments in the model wherever something is redundant. Something like
(* note: strong-fence is included here for completeness, and can be safely
ignored *).
Alan
redundancies might be annotated this way or eliminated.