CS252/Patterson Lec 12.1 2/28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization.

Slides:



Advertisements
Similar presentations
L.N. Bhuyan Adapted from Patterson’s slides
Advertisements

CMSC 611: Advanced Computer Architecture
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
The University of Adelaide, School of Computer Science
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.
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.
EECC756 - Shaaban #1 lec # 13 Spring Scalable Cache Coherent Systems Scalable distributed shared memory machines Assumptions: –Processor-Cache-Memory.
CS252/Patterson Lec /28/01 CS 213 Lecture 9: Multiprocessor: Directory Protocol.
1 Lecture 5: Directory Protocols Topics: directory-based cache coherence implementations.
NUMA coherence CSE 471 Aut 011 Cache Coherence in NUMA Machines Snooping is not possible on media other than bus/ring Broadcast / multicast is not that.
EECC756 - Shaaban #1 lec # 12 Spring Scalable Cache Coherent Systems Scalable distributed shared memory machines Assumptions: –Processor-Cache-Memory.
EECC756 - Shaaban #1 lec # 11 Spring Scalable Cache Coherent Systems Scalable distributed shared memory machines Assumptions: –Processor-Cache-Memory.
1 Lecture 3: Directory-Based Coherence Basic operations, memory-based and cache-based directories.
CS252/Patterson Lec /28/01 CS162 Computer Architecture Lecture 16: Multiprocessor 2: Directory Protocol, Interconnection Networks.
Cache Coherence for Large-Scale Machines Todd C. Mowry CS 495 Sept. 26 & Oct. 1, 2002 Topics Hierarchies Directory Protocols.
1 Shared-memory Architectures Adapted from a lecture by Ian Watson, University of Machester.
Multiprocessor Cache Coherency
Spring 2003CSE P5481 Cache Coherency Cache coherent processors reading processor must get the most current value most current value is the last write Cache.
1 Cache coherence CEG 4131 Computer Architecture III Slides developed by Dr. Hesham El-Rewini Copyright Hesham El-Rewini.
1 Lecture 22 Multiprocessor Performance Adapted from UCB CS252 S01, Copyright 2001 USB.
Lecture 3. Directory-based Cache Coherence Prof. Taeweon Suh Computer Science Education Korea University COM503 Parallel Computer Architecture & Programming.
EECS 252 Graduate Computer Architecture Lec 13 – Snooping Cache and Directory Based Multiprocessors David Patterson Electrical Engineering and Computer.
Cache Control and Cache Coherence Protocols How to Manage State of Cache How to Keep Processors Reading the Correct Information.
CS252 Graduate Computer Architecture Lecture 20 April 12 th, 2010 Distributed Shared Memory Prof John D. Kubiatowicz
Computer Science and Engineering Copyright by Hesham El-Rewini Advanced Computer Architecture CSE 8383 March 20, 2008 Session 9.
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
CMSC 611: Advanced Computer Architecture Shared Memory Directory Protocol Most slides adapted from David Patterson. Some from Mohomed Younis.
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
Architecture and Design of AlphaServer GS320
Scalable Cache Coherent Systems
The University of Adelaide, School of Computer Science
CS 704 Advanced Computer Architecture
Lecture 18: Coherence and Synchronization
Multiprocessor Cache Coherency
Scalable Cache Coherent Systems
CMSC 611: Advanced Computer Architecture
Example Cache Coherence Problem
CPE 631 Session 22: Multiprocessors (Part 3)
Lecture 9: Directory-Based Examples II
Scalable Cache Coherent Systems
CPE 631 Session 21: Multiprocessors (Part 2)
Lecture 8: Directory-Based Cache Coherence
Lecture 7: Directory-Based Cache Coherence
11 – Snooping Cache and Directory Based Multiprocessors
CS 213 Lecture 11: Multiprocessor 3: Directory Organization
Lecture 25: Multiprocessors
Lecture 9: Directory-Based Examples
Scalable Cache Coherent Systems
Professor David A. Patterson Computer Science 252 Spring 1998
Slides developed by Dr. Hesham El-Rewini Copyright Hesham El-Rewini
Lecture 8: Directory-Based Examples
Lecture 25: Multiprocessors
The University of Adelaide, School of Computer Science
Cache coherence CEG 4131 Computer Architecture III
Scalable Cache Coherent Systems
Scalable Cache Coherent Systems
Coherent caches Adapted from a lecture by Ian Watson, University of Machester.
Lecture 17 Multiprocessors and Thread-Level Parallelism
CPE 631 Lecture 20: Multiprocessors
The University of Adelaide, School of Computer Science
Scalable Cache Coherent Systems
Lecture 10: Directory-Based Examples II
Scalable Cache Coherent Systems
Scalable Cache Coherent Systems
Presentation transcript:

CS252/Patterson Lec /28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization

CS252/Patterson Lec /28/01 Larger MPs Separate Memory per Processor Local or Remote access via memory controller 1 Cache Coherency solution: non-cached pages Alternative: directory per cache that tracks state of every block in every cache –Which caches have a copies of block, dirty vs. clean,... Info per memory block vs. per cache block? –PLUS: In memory => simpler protocol (centralized/one location) –MINUS: In memory => directory is ƒ(memory size) vs. ƒ(cache size) Prevent directory as bottleneck? distribute directory entries with memory, each keeping track of which Procs have copies of their blocks

CS252/Patterson Lec /28/01 Organizing Directories CentralizedDistributed Hierarchical Flat Memory-basedCache-based Directory Schemes How to find source of directory information How to locate copies

CS252/Patterson Lec /28/01 How to Find Directory Information centralized memory and directory - easy: go to it –but not scalable distributed memory and directory –flat schemes »directory distributed with memory: at the home »location based on address (hashing): network xaction sent directly to home –hierarchical schemes »??

CS252/Patterson Lec /28/01 Distributed Directory MPs

CS252/Patterson Lec /28/01 How Is Location of Copies Stored? –vary a lot –different storage overheads and performance characteristics –Memory-based schemes »info about copies stored all at the home with the memory block »Dash, Alewife, SGI Origin, Flash –Cache-based schemes »info about copies distributed among copies themselves each copy points to next »Scalable Coherent Interface (SCI: IEEE standard)

CS252/Patterson Lec /28/01 Flat, Memory-based Schemes info about copies colocated with block at the home –just like centralized scheme, except distributed Performance Scaling –traffic on a write: proportional to number of sharers –latency on write: can issue invalidations to sharers in parallel Storage overhead –simplest representation: full bit vector, i.e. one presence bit per node –storage overhead doesn’t scale well with P; 64-byte line implies »64 nodes: 12.7% ovhd. »256 nodes: 50% ovhd.; 1024 nodes: 200% ovhd. –for M memory blocks in memory, storage overhead is proportional to P*M P M

CS252/Patterson Lec /28/01 Implementing a Directory Directory has a table to track which processors have data in the shared state (usually bit vector, 1 if processor has copy). Also, distinguish between shared/exclusive when present in only one processor by another column. We assume operations atomic, but they are not; reality is much harder; must avoid deadlock when run out of buffers in network (see Appendix E) Optimizations: –read miss or write miss in Exclusive: send data directly to requestor from owner vs. 1st to memory and then from memory to requestor

CS252/Patterson Lec /28/01

CS252/Patterson Lec /28/01 Directory Protocol Similar to Snoopy Protocol: Three states –Shared: ≥ 1 or more processors have data, memory is up- to-date –Uncached (no processor has data; not valid in any cache) –Exclusive: 1 processor (owner) has data; memory may be out-of-date Keep the protocol simple: –Writes to non-exclusive data => write miss –Processor blocks until access completes –Assume messages received and acted upon in order sent

CS252/Patterson Lec /28/01 Directory Protocol No bus and don’t want to broadcast: –interconnect no longer single arbitration point –all messages have explicit responses Terms: typically 3 processors involved –Local node where a request originates –Home node where the memory location of an address resides –Remote node has a copy of a cache block, whether exclusive or shared Example messages on next slide: P = processor number, A = address

CS252/Patterson Lec /28/01 Directory Protocol Messages Message typeSourceDestinationMsg Content Read miss Local cacheHome directoryP, A –Processor P reads data at address A; make P a read sharer and arrange to send data back Write miss Local cache Home directory P, A –Processor P writes data at address A; make P the exclusive owner and arrange to send data back Invalidate Home directory Remote cachesA –Invalidate a shared copy at address A. Fetch Home directory Remote cache A –Fetch the block at address A and send it to its home directory Fetch/Invalidate Home directory Remote cache A –Fetch the block at address A and send it to its home directory; invalidate the block in the cache Data value reply Home directory Local cache Data –Return a data value from the home memory (read miss response) Data write-back Remote cache Home directory A, Data –Write-back a data value for address A (invalidate response)

CS252/Patterson Lec /28/01 State Transition Diagram for an Individual Cache Block in a Directory Based System States identical to snoopy case; transactions very similar. Transitions caused by read misses, write misses, invalidates, data fetch requests Generates read miss & write miss msg to home directory. Write misses that were broadcast on the bus for snooping => explicit invalidate & data fetch requests. Note: on a write, a cache block is bigger, so need to read the full cache block

CS252/Patterson Lec /28/01 CPU -Cache State Machine State machine for CPU requests for each memory block Invalid state if in memory Fetch/Invalidate send Data Write Back message to home directory Invalidate Invalid Shared (read/only) Exclusive (read/writ) CPU Read CPU Read hit Send Read Miss message CPU Write: Send Write Miss msg to h.d. CPU Write:Send Write Miss message to home directory CPU read hit CPU write hit Fetch: send Data Write Back message to home directory CPU read miss: Send Read Miss CPU write miss: send Data Write Back message and Write Miss to home directory CPU read miss: send Data Write Back message and read miss to home directory

CS252/Patterson Lec /28/01 State Transition Diagram for the Directory Same states & structure as the transition diagram for an individual cache 2 actions: update of directory state & send msgs to satisfy requests Tracks all copies of memory block. Also indicates an action that updates the sharing set, Sharers, as well as sending a message.

CS252/Patterson Lec /28/01 Directory State Machine State machine for Directory requests for each memory block Uncached state if in memory Data Write Back: Sharers = {} (Write back block) Uncached Shared (read only) Exclusive (read/writ) Read miss: Sharers = {P} send Data Value Reply Write Miss: send Invalidate to Sharers; then Sharers = {P}; send Data Value Reply msg Write Miss: Sharers = {P}; send Data Value Reply msg Read miss: Sharers += {P}; send Fetch; send Data Value Reply msg to remote cache (Write back block) Read miss: Sharers += {P}; send Data Value Reply Write Miss: Sharers = {P}; send Fetch/Invalidate; send Data Value Reply msg to remote cache

CS252/Patterson Lec /28/01 Example Directory Protocol Message sent to directory causes two actions: –Update the directory –More messages to satisfy request Block is in Uncached state: the copy in memory is the current value; only possible requests for that block are: –Read miss: requesting processor sent data from memory &requestor made only sharing node; state of block made Shared. –Write miss: requesting processor is sent the value & becomes the Sharing node. The block is made Exclusive to indicate that the only valid copy is cached. Sharers indicates the identity of the owner. Block is Shared => the memory value is up-to-date: –Read miss: requesting processor is sent back the data from memory & requesting processor is added to the sharing set. –Write miss: requesting processor is sent the value. All processors in the set Sharers are sent invalidate messages, & Sharers is set to identity of requesting processor. The state of the block is made Exclusive.

CS252/Patterson Lec /28/01 Example Directory Protocol Block is Exclusive : current value of the block is held in the cache of the processor identified by the set Sharers (the owner) => three possible directory requests: –Read miss: owner processor receives data fetch message from home directory, causing state of block in owner’s cache to transition to Shared and causes owner to send data to directory, where it is written to memory & sent back to requesting processor. Identity of requesting processor is added to set Sharers, which still contains the identity of the processor that was the owner (since it still has a readable copy). State is shared. –Data write-back: owner processor is replacing the block and hence must write it back, making memory copy up-to-date (the home directory essentially becomes the owner), the block is now Uncached, and the Sharer set is empty.

CS252/Patterson Lec /28/01 Example Directory Protocol Contd. –Write miss: block has a new owner. A message is sent to old owner causing the cache to send the value of the block to the directory from which it is sent to the requesting processor, which becomes the new owner. Sharers is set to identity of new owner, and state of block is made Exclusive. Cache to Cache Transfer: Can occur with a remote read or write miss. Idea: Transfer block directly from the cache with exclusive copy to the requesting cache. Why go through directory? Rather inform directory after the block is transferred => 3 transfers over the IN instead of 4.

CS252/Patterson Lec /28/01 Basic Directory Transactions

CS252/Patterson Lec /28/01 Protocol Enhancements for Latency Forwarding messages: memory-based protocols Intervention is like a req, but issued in reaction to req. and sent to cache, rather than memory.

CS252/Patterson Lec /28/01 Assume Network latency = 25 cycles