The English word Serial - adjective form:
- occurring in a series rather than simultaneously
Computers.
a) of or relating to the apparent or actual performance of data-processing operations one at a time (distinguished from
parallel).
b) of or relating to the transmission or processing of each
part of a whole in sequence, as each bit of a byte or each byte of a
computer word (distinguished from parallel).
(Serialization can also mean converting an object representation to a bit-stream or byte-stream which can be stored to disk or sent over a network outside of the program. But that's not the meaning that applies in the context of sfence
).
Database https://en.wikipedia.org/wiki/Serializability is a more closely related concept.
SFENCE orders the global visibility of earlier stores with respect to SFENCE itself, and later stores. Serializing = imposing an order on things, stopping them from overlapping or happening in parallel.
Note that in Intel terminology, "serializing instruction" has a special meaning: an instruction that flushes the store buffer and the out-of-order instruction pipeline before any later instructions can execute. (They can decode and maybe even issue into the out-of-order core, but not execute). How many memory barriers instructions does an x86 CPU have?
sfence
is not a "serializing instruction" in that sense; it only orders NT stores with respect to each other and regular stores. (Regular stores are already ordered with respect to each other, so sfence
has no effect if there are no NT stores in flight. All you need for correct release semantics is to put regular stores in the right order, e.g. with a compiler barrier to stop compile-time reordering.)
"serializing" in Intel's definition of sfence
is just the plain English meaning of the term, not the "serializing instruction" x86 special meaning.
Current wording of Intel's ISA ref manual entry for sfence
:
Intel rewrote the opening paragraph to say "orders" instead of "serializes", except in the short description: Serializes store operations.
The main Description is:
Orders processor execution relative to all memory stores prior to the SFENCE instruction. The processor ensures that every store prior to SFENCE is globally visible before any store after SFENCE becomes globally visible. The SFENCE instruction is ordered with respect to memory stores, other SFENCE instructions, MFENCE instructions, and any serializing instructions (such as the CPUID instruction). It is not ordered with respect to memory loads or the LFENCE instruction.
The first sentence is still kind of bogus, though. Execution isn't ordered, only commit to L1d cache.