i
i
i
i
i
i
i
i
262 CHAPTER 7. BASIC CACHE COHERENCE ISSUES
Read3 Sc Sc Sc BusRd(C) Mem 90
Read3 Sc Sc Sc - - 1
Write1 Sm Sc Sc BusUpd(C) - 60
Write1 Sm Sc Sc BusUpd(C) - 60
Write1 Sm Sc Sc BusUpd(C) - 60
Write1 Sm Sc Sc BusUpd(C) - 60
Write2 Sc Sm Sc BusUpd(C) - 60
Write3 Sc Sc Sm BusUpd(C) - 60
TOTAL 631
Homework Problems
1. Suppose a 4-processor system uses a bus-based broadcast/snoopy coherence protocol. As-
sume that the cost of processing a protocol transaction depends on where data is supplied
and whether it involves a bus transaction. A cache hit not involving a bus transaction costs 1
cycle, a cache hit involving a bus transaction costs 10 cycles. A cache miss with data supplied
by another cache costs 50 cycles. A cache miss with data supplied by the main memory costs
80 cycles. The caches uses MSI coherence protocol. Show what happens to cache states after
each memory reference. The memory reference stream is: R1 (read by processor 1), R2, R3,
R2, W3 (write by processor 3), E3 (eviction by processor 3), W4, R2, R3, W1.
2. Repeat homework problem (1) for MESI protocol.
3. Repeat homework problem (1) for MOESI protocol.
4. Repeat homework problem (1) for Dragon protocol. Additionally, assume that any memory
reference that involves a BusUpd transaction requires 50 clock cycles to complete.
5. Some systems have implemented MOSI protocol to allow dirty sharing, which consists of
four states: modified, owned, shared, and invalid. The meaning of the states are:
• Modified: data is dirty and can only be kept in one cache
• Owned: data is dirty and may be kept in multiple caches, but only one of them has it in
the owned state
• Shared: data may be clean/dirty, and may be kept in multiple caches
• Invalid: data is uncached or invalid
Assume a bus-based multiprocessor with write back caches. The following bus transactions
are available: BusRd, BusRdX, BusUpgr, and Flush. FlushOpt is not implemented. Show
the state transition diagram for processor-initiated requests, and state transition diagram for
snooped bus requests.
6. Compare the latencies of MSI and MESI for the following cases: (a) read latency for data
that was earlier read by one other processor, (b) write latency for data that is read then written
by only one processor, and (3) read latency for data that is written by one processor and then
read by another processor.