I think this concern is addressed (though hardly explicitly) by the
following two sections (in two different manuals!!!):
In section 7.2.2 of the System Programming manual, rule 5 states:
"5. Writes are not performed speculatively; they are only performed for
instructions that have actually been retired"
In section 2.5.5 of the Basic Architecture manual it states:
"It [the retirement unit] then retires completed micro-ops in their original
program oder, taking into account interrupts, exceptions, breakpoints and
branch mis-predictions"
So if I read this correctly, the read instruction (which includes the
actual read from memory) will have been retired before the write is
actually performed so in Linus' example, the actual read associated with
'read b' on CPU #1 can never happen after the actual write associated with
'a = 0' is performed so it can never see the "future" write of "b".
If my reading of this is correct, then it could have been covered by a
new rule (call it 2a) in section 7.2.2 of the System Programming manual:
"2a. Writes cannot pass reads"
Brian
-- ObAFUFAQ: F. Couple w/baby on long trip stops to switch places; place baby on roof; they forget it up there! Police cruiser pull them over and baby is rescued. ["The Baby on the Roof" in TCD.]bkelly@sulaco.com
- 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/