1 Lecture 3: Snooping Protocols Topics: snooping-based cache coherence implementations.

Slides:



Advertisements
Similar presentations
Extra Cache Coherence Examples In the following examples there are a couple questions. You can answer these for practice by ing Colin at
Advertisements

1 Lecture 6: Directory Protocols Topics: directory-based cache coherence implementations (wrap-up of SGI Origin and Sequent NUMA case study)
1 Lecture 4: Directory Protocols Topics: directory-based cache coherence implementations.
Cache Optimization Summary
1 Lecture 12: Hardware/Software Trade-Offs Topics: COMA, Software Virtual Memory.
The University of Adelaide, School of Computer Science
CS 7810 Lecture 19 Coherence Decoupling: Making Use of Incoherence J.Huh, J. Chang, D. Burger, G. Sohi Proceedings of ASPLOS-XI October 2004.
CIS629 Coherence 1 Cache Coherence: Snooping Protocol, Directory Protocol Some of these slides courtesty of David Patterson and David Culler.
1 Lecture 4: Directory-Based Coherence Details of memory-based (SGI Origin) and cache-based (Sequent NUMA-Q) directory protocols.
1 Lecture 21: Synchronization Topics: lock implementations (Sections )
CS252/Patterson Lec /23/01 CS213 Parallel Processing Architecture Lecture 7: Multiprocessor Cache Coherency Problem.
1 Lecture 2: Snooping and Directory Protocols Topics: Snooping wrap-up and directory implementations.
1 Lecture 20: Coherence protocols Topics: snooping and directory-based coherence protocols (Sections )
1 Lecture 1: Introduction Course organization:  4 lectures on cache coherence and consistency  2 lectures on transactional memory  2 lectures on interconnection.
1 Lecture 18: Coherence Protocols Topics: coherence protocols for symmetric and distributed shared-memory multiprocessors (Sections )
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Nov 14, 2005 Topic: Cache Coherence.
1 Lecture 5: Directory Protocols Topics: directory-based cache coherence implementations.
1 Lecture 2: Intro and Snooping Protocols Topics: multi-core cache organizations, programming models, cache coherence (snooping-based)
1 Lecture 3: Directory-Based Coherence Basic operations, memory-based and cache-based directories.
Logical Protocol to Physical Design
CS252/Patterson Lec /28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization.
1 Lecture 20: Protocols and Synchronization Topics: distributed shared-memory multiprocessors, synchronization (Sections )
Snoopy Coherence Protocols Small-scale multiprocessors.
1 Shared-memory Architectures Adapted from a lecture by Ian Watson, University of Machester.
Spring 2003CSE P5481 Cache Coherency Cache coherent processors reading processor must get the most current value most current value is the last write Cache.
Lecture 7: PCM, Cache coherence
Presented By:- Prerna Puri M.Tech(C.S.E.) Cache Coherence Protocols MSI & MESI.
Cache Control and Cache Coherence Protocols How to Manage State of Cache How to Keep Processors Reading the Correct Information.
Ch4. Multiprocessors & Thread-Level Parallelism 2. SMP (Symmetric shared-memory Multiprocessors) ECE468/562 Advanced Computer Architecture Prof. Honggang.
Effects of wrong path mem. ref. in CC MP Systems Gökay Burak AKKUŞ Cmpe 511 – Computer Architecture.
1 Lecture 12: Hardware/Software Trade-Offs Topics: COMA, Software Virtual Memory.
Cache Coherence Protocols A. Jantsch / Z. Lu / I. Sander.
1 Lecture 19: Scalable Protocols & Synch Topics: coherence protocols for distributed shared-memory multiprocessors and synchronization (Sections )
1 Lecture 3: Coherence Protocols Topics: consistency models, coherence protocol examples.
Cache Coherence CS433 Spring 2001 Laxmikant Kale.
1 Lecture 7: PCM Wrap-Up, Cache coherence Topics: handling PCM errors and writes, cache coherence intro.
1 Lecture: Coherence Topics: snooping-based coherence, directory-based coherence protocols (Sections )
1 Lecture 7: Implementing Cache Coherence Topics: implementation details.
CMSC 611: Advanced Computer Architecture Shared Memory Most slides adapted from David Patterson. Some from Mohomed Younis.
The University of Adelaide, School of Computer Science
1 Lecture 8: Snooping and Directory Protocols Topics: 4/5-state snooping protocols, split-transaction implementation details, directory implementations.
Lecture 8: Snooping and Directory Protocols
תרגול מס' 5: MESI Protocol
CS 704 Advanced Computer Architecture
Lecture 18: Coherence and Synchronization
Cache Coherence for Shared Memory Multiprocessors
CMSC 611: Advanced Computer Architecture
Example Cache Coherence Problem
Lecture 9: Directory-Based Examples II
Lecture 2: Snooping-Based Coherence
Lecture 5: Snooping Protocol Design Issues
Lecture 8: Directory-Based Cache Coherence
Lecture 4: Update Protocol
Lecture 21: Synchronization and Consistency
11 – Snooping Cache and Directory Based Multiprocessors
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Lecture 25: Multiprocessors
Lecture 9: Directory-Based Examples
Lecture 4: Synchronization
Lecture 8: Directory-Based Examples
Lecture 25: Multiprocessors
Lecture 24: Virtual Memory, Multiprocessors
Lecture 24: Multiprocessors
Lecture: Coherence, Synchronization
Lecture: Coherence Topics: wrap-up of snooping-based coherence,
Lecture 3: Coherence Protocols
Lecture: Coherence and Synchronization
Lecture 19: Coherence and Synchronization
Lecture 18: Coherence and Synchronization
Lecture 10: Directory-Based Examples II
Presentation transcript:

1 Lecture 3: Snooping Protocols Topics: snooping-based cache coherence implementations

2 Design Issues, Optimizations When does memory get updated?  demotion from modified to shared?  move from modified in one cache to modified in another? Who responds with data? – memory or a cache that has the block in exclusive state – does it help if sharers respond? We can assume that bus, memory, and cache state transactions are atomic – if not, we will need more states A transition from shared to modified only requires an upgrade request and no transfer of data Is the protocol simpler for a write-through cache?

3 4-State Protocol Multiprocessors execute many single-threaded programs A read followed by a write will generate bus transactions to acquire the block in exclusive state even though there are no sharers Note that we can optimize protocols by adding more states – increases design/verification complexity

4 MESI Protocol The new state is exclusive-clean – the cache can service read requests and no other cache has the same block When the processor attempts a write, the block is upgraded to exclusive-modified without generating a bus transaction When a processor makes a read request, it must detect if it has the only cached copy – the interconnect must include an additional signal that is asserted by each cache if it has a valid copy of the block

5 Design Issues When caches evict blocks, they do not inform other caches – it is possible to have a block in shared state even though it is an exclusive-clean copy Cache-to-cache sharing: SRAM vs. DRAM latencies, contention in remote caches, protocol complexities (memory has to wait, which cache responds), can be especially useful in distributed memory systems The protocol can be improved by adding a fifth state (owner – MOESI) – the owner services reads (instead of memory)

6 Update Protocol (Dragon) 4-state write-back update protocol, first used in the Dragon multiprocessor (1984) Write-back update is not the same as write-through – on a write, only caches are updated, not memory Goal: writes may usually not be on the critical path, but subsequent reads may be

7 4 States No invalid state Modified and Exclusive-clean as before: used when there is a sole cached copy Shared-clean: potentially multiple caches have this block and main memory may or may not be up-to-date Shared-modified: potentially multiple caches have this block, main memory is not up-to-date, and this cache must update memory – only one block can be in Sm state In reality, one state would have sufficed – more states to reduce traffic

8 Design Issues If the update is also sent to main memory, the Sm state can be eliminated If all caches are informed when a block is evicted, the block can be moved from shared to M or E – this can help save future bus transactions Having an extra wire to determine exclusivity seems like a worthy trade-off in update systems

9 State Transitions To From NPIESM I E S M To From NPIESM -- BusRd BusRdX I-- BusRd BusRdX E-- S Not possible--BusUpgr MBusWB Not possibleBusWB-- State transitions per 1000 data memory references for Ocean Bus actions for each state transition NP – Not Present

10 Basic Implementation Assume single level of cache, atomic bus transactions It is simpler to implement a processor-side cache controller that monitors requests from the processor and a bus-side cache controller that services the bus Both controllers are constantly trying to read tags  tags can be duplicated (moderate area overhead)  unlike data, tags are rarely updated  tag updates stall the other controller

11 Reporting Snoop Results Uniprocessor system: initiator places address on bus, all devices monitor address, one device acks by raising a wired-OR signal, data is transferred In a multiprocessor, memory has to wait for the snoop result before it chooses to respond – need 3 wired-OR signals: (i) indicates that a cache has a copy, (ii) indicates that a cache has a modified copy, (iii) indicates that the snoop has not completed Ensuring timely snoops: the time to respond could be fixed or variable (with the third wired-OR signal), or the memory could track if a cache has a block in M state

12 Non-Atomic State Transitions Note that a cache controller’s actions are not all atomic: tag look-up, bus arbitration, bus transaction, data/tag update Consider this: block A in shared state in P1 and P2; both issue a write; the bus controllers are ready to issue an upgrade request and try to acquire the bus; is there a problem? The controller can keep track of additional intermediate states so it can react to bus traffic (e.g. S  M, I  M, I  S,E) Alternatively, eliminate upgrade request; use the shared wire to suppress memory’s response to an exclusive-rd

13 Livelock Livelock can happen if the processor-cache handshake is not designed correctly Before the processor can attempt the write, it must acquire the block in exclusive state If all processors are writing to the same block, one of them acquires the block first – if another exclusive request is seen on the bus, the cache controller must wait for the processor to complete the write before releasing the block -- else, the processor’s write will fail again because the block would be in invalid state

14 Split Transaction Bus What would it take to implement the protocol correctly while assuming a split transaction bus? Split transaction bus: a cache puts out a request, releases the bus (so others can use the bus), receives its response much later Assumptions:  only one request per block can be outstanding  separate lines for addr (request) and data (response)

15 Split Transaction Bus Proc 1 Cache Proc 2 Cache Proc 3 Cache Request lines Response lines

16 Design Issues When does the snoop complete? What if the snoop takes a long time? What if the buffer in a processor/memory is full? When does the buffer release an entry? Are the buffers identical? How does each processor ensure that a block does not have multiple outstanding requests? What determines the write order – requests or responses?

17 Design Issues II What happens if a processor is arbitrating for the bus and witnesses another bus transaction for the same address? If the processor issues a read miss and there is already a matching read in the request table, can we reduce bus traffic?

18 Title Bullet