That wasn't my understanding.
read B read A (<- speculative)
A = 1
B = 0
read A (*)
Here read B=?, but read A=1. A is read speculatively, but because
write B=0 is seen *after* the write A=1, the speculative read on A is
thrown away. The speculative read for B is accepted because there
were no writes to B before the write to A.
Just flip the diagram to get the case for B.
It is my understanding that a read for A that follows a write to B on
one processor can move *before* that write, but the read result on A
isn't retired until after the write to B occurs (in processor order).
The processor sees all writes before it's own that have occurred after
the read (so it sees A=1), and if any of them touch A, it will
invalidated the read on A, *before* its result is retired. The read
is redone, and it gets the correct value for A.
Drago
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/