3 ms·
> Actually the main reason you see things out of order on a modern CPU are core-local reasons, like store buffering, store forwarding, load buffering, delayed i
by avianes 6y ago
> Actually the main reason you see things out of order on a modern CPU are core-local reasons, like store buffering, store forwarding, load buffering, delayed invalidation processing and out of order execution.
yes, precisely, since the store buffer is designed to ensure access ordering according to the consistency model.
Otherwise there is no guarantee that two accesses with different addresses (potentially targeting different memories) will be performed and visible in the original order.
That's why we need to specify the memory consistency model, and design hardware components to satisfy it.
- BeeOnRope 6y agoThe store buffer helps keeps stores in order, sure, but the store buffer is the main reason (on x86) that reordering happens. So positioning it as the savior of consistency doesn't seem right. Store buffer is there for some key reasons apart from consistency: (a) in OoO execution stores must not escape the core until instruction retirement (or else speculative results could become visible), so you need to buffer them and (b) performance. (a) already implies an ordered buffer, and you also have to keep some notion of ordering to satisfy store forwards correctly.