Sequential consistency (SC) requires that all reads and writes appear to have executed in some total order. This may require the processor to stall in certain cases before committing a read or write instruction. Con- sider the following code sequence:
write A
read B
where the write A results in a cache miss and the read B results in a cache hit. Under SC, the processor must stall read B until after it can order (and thus per- form) write A. Simple implementations of SC will stall the processor until the cache receives the data and can perform the write.
Weaker consistency models relax the ordering constraints on reads and writes, reducing the cases that the processor must stall. The Total Store Order (TSO) consistency model requires that all writes appear to occur in a total order, but allows a processorâs reads to pass its own writes. This allows processors to implement write buffers, which hold committed writes that have not yet been ordered with respect to other processorâs writes. Reads are allowed to pass (and potentially bypass) the write buffer in TSO (which they could not do under SC).
Assume that one memory operation can be performed per cycle and that operations that hit in the cache or that can be satisfied by the write buffer introduce no stall cycles. Operations that miss incur the latencies listed in Figure 4.41. Assume the cache contents of Figure 4.37 and the base switched protocol of Exercise 4.8. How many stall cycles occur prior to each operation for both the SC and TSO consistency models?
a. P0: write 110
P0: read 108
b. P0: write 100
P0: read 108
c. P0: write 110
P0: write 100
d. P0: write 100
P0: write 110
No comments:
Post a Comment