Presented By:- Prerna Puri M.Tech(C.S.E.) Cache Coherence Protocols MSI & MESI.

Slides:



Advertisements
Similar presentations
Cache Coherence Mechanisms (Research project) CSCI-5593
Advertisements

Extra Cache Coherence Examples In the following examples there are a couple questions. You can answer these for practice by ing Colin at
Lecture 7. Multiprocessor and Memory Coherence
Multi-core systems System Architecture COMP25212 Daniel Goodman Advanced Processor Technologies Group.
Lecture 2. Snoop-based Cache Coherence Protocols
Cache Optimization Summary
Technical University of Lodz Department of Microelectronics and Computer Science Elements of high performance microprocessor architecture Shared-memory.
CS252 Graduate Computer Architecture Lecture 25 Memory Consistency Models and Snoopy Bus Protocols Prof John D. Kubiatowicz
Computer Architecture II 1 Computer architecture II Lecture 8.
CIS629 Coherence 1 Cache Coherence: Snooping Protocol, Directory Protocol Some of these slides courtesty of David Patterson and David Culler.
EECC756 - Shaaban #1 lec # 10 Spring Shared Memory Multiprocessors Symmetric Memory Multiprocessors (SMPs): commonly 2-4 processors/node.
CS 258 Parallel Computer Architecture Lecture 13 Shared Memory Multiprocessors March 10, 2008 Prof John D. Kubiatowicz
EECC756 - Shaaban #1 lec # 11 Spring Shared Memory Multiprocessors Symmetric Multiprocessors (SMPs): –Symmetric access to all of main memory.
CS252/Patterson Lec /23/01 CS213 Parallel Processing Architecture Lecture 7: Multiprocessor Cache Coherency Problem.
1 Lecture 1: Introduction Course organization:  4 lectures on cache coherence and consistency  2 lectures on transactional memory  2 lectures on interconnection.
1 Lecture 3: Snooping Protocols Topics: snooping-based cache coherence implementations.
Computer architecture II
Cache Coherence: Part 1 Todd C. Mowry CS 740 November 4, 1999 Topics The Cache Coherence Problem Snoopy Protocols.
Bus-Based Multiprocessor
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Nov 14, 2005 Topic: Cache Coherence.
1 Lecture 2: Intro and Snooping Protocols Topics: multi-core cache organizations, programming models, cache coherence (snooping-based)
CPE 731 Advanced Computer Architecture Snooping Cache Multiprocessors Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of.
EECC756 - Shaaban #1 lec # 10 Spring Multiprocessors Cache Coherence in Bus-Based Shared Memory Multiprocessors Shared Memory Multiprocessors.
Cache Coherence in Bus-Based Shared Memory Multiprocessors
CS252/Patterson Lec /28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization.
CS 258 Parallel Computer Architecture Lecture 12 Shared Memory Multiprocessors II March 1, 2002 Prof John D. Kubiatowicz
Snooping Cache and Shared-Memory Multiprocessors
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.
©RG:E0243:L2- Parallel Architecture 1 E0-243: Computer Architecture L2 – Parallel Architecture.
POLITECNICO DI MILANO Parallelism in wonderland: are you ready to see how deep the rabbit hole goes? Cache coherence, etc… Cache coherence, etc… - MIMD.
CS492B Analysis of Concurrent Programs Coherence Jaehyuk Huh Computer Science, KAIST Part of slides are based on CS:App from CMU.
Spring EE 437 Lillevik 437s06-l21 University of Portland School of Engineering Advanced Computer Architecture Lecture 21 MSP shared cached MSI protocol.
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.
Cache Coherence CSE 661 – Parallel and Vector Architectures
Evaluating the Performance of Four Snooping Cache Coherency Protocols Susan J. Eggers, Randy H. Katz.
Cache Coherence Protocols A. Jantsch / Z. Lu / I. Sander.
1 Memory and Cache Coherence. 2 Shared Memory Multiprocessors Symmetric Multiprocessors (SMPs) Symmetric access to all of main memory from any processor.
Lecture 9 ECE/CSC Spring E. F. Gehringer, based on slides by Yan Solihin1 Lecture 9 Outline  MESI protocol  Dragon update-based protocol.
Multiprocessors— Flynn Categories, Large vs. Small Scale, Cache Coherency Professor Alvin R. Lebeck Computer Science 220 Fall 2001.
Cache Coherence for Small-Scale Machines Todd C
1 Lecture 3: Coherence Protocols Topics: consistency models, coherence protocol examples.
ECE 4100/6100 Advanced Computer Architecture Lecture 13 Multiprocessor and Memory Coherence Prof. Hsien-Hsin Sean Lee School of Electrical and Computer.
Cache Coherence CS433 Spring 2001 Laxmikant Kale.
1 Lecture 7: PCM Wrap-Up, Cache coherence Topics: handling PCM errors and writes, cache coherence intro.
The University of Adelaide, School of Computer Science
Computer Architecture Lecture 29: Cache Coherence Prof. Onur Mutlu Carnegie Mellon University Spring 2015, 4/10/2015.
Outline Introduction (Sec. 5.1)
COSC6385 Advanced Computer Architecture
תרגול מס' 5: MESI Protocol
Cache Coherence in Shared Memory Multiprocessors
A Study on Snoop-Based Cache Coherence Protocols
Cache Coherence for Shared Memory Multiprocessors
Lecture 9 Outline MESI protocol Dragon update-based protocol
Prof. Gennady Pekhimenko University of Toronto Fall 2017
Example Cache Coherence Problem
Protocol Design Space of Snooping Cache Coherent Multiprocessors
Lecture 2: Snooping-Based Coherence
Chip-Multiprocessor.
Cache Coherence in Bus-Based Shared Memory Multiprocessors
Lecture 4: Update Protocol
Bus-Based Coherent Multiprocessors
Shared Memory Multiprocessors
Lecture 8 Outline Memory consistency
Prof. Onur Mutlu ETH Zürich Fall November 2017
CS 258 Parallel Computer Architecture Lecture 16 Snoopy Protocols I
Prof John D. Kubiatowicz
Presentation transcript:

Presented By:- Prerna Puri M.Tech(C.S.E.) Cache Coherence Protocols MSI & MESI

Contents Cache and cache coherence Shared cache design advantages MSI WB Protocol State Transition in the MSI Protocol Cache coherence problem MSI example MESI WB Protocol Four states-MESI MESI state transition diagram

Cache and Cache coherence Cache play an important role to Reduce average latency Main memory access costs from 100 to 1000 cycles Caches can reduce latency to few cycles Reduce average bandwidth and demand to access main memory Reduce access to shared bus or interconnect  But private caches create a problem Copies of a variable can be present in multiple caches A write by one processor may NOT become visible to others. Other processors keep accessing old value in their caches

Shared Cache Design: Advantages Cache placement identical to single cache  Only one copy of any cached block  No coherence problem Communication latency is reduced when sharing cache Attractive to Chip Multiprocessors (CMP), latency is few cycles Better utilization of total storage Only one copy of code/data used

MSI Write-Back Invalidate Protocol Three States: Modified: only this cache has a modified valid copy of the block Shared: block is clean and may be cached in more than one cache, memory is up-to-date Invalid: block is invalid Four bus transactions: Bus Read: BusRd on a read miss Bus Read Exclusive: BusRdX Obtain exclusive copy of cache block

Bus Write-Back: BusWB on replacement Flush on BusRd or BusRdX Cache puts data block on the bus in lieu of memory Cache-to-cache transfer and memory is updated Cont..

State Transitions in the MSI Protocol Processor Read Cache miss  causes a Bus Read Cache hit (S or M)  no bus activity Processor Write Generates a BusRdX when not Modified BusRdX causes other caches to invalidate No bus activity when Modified block Observing a Bus Read If Modified, flush block on bus Picked by memory and requesting cache Block is now shared Observing a Bus Read Exclusive Invalidate block Flush data on bus if block is modified M I S PrRd/— PrWr/— PrRd/BusRd PrWr/BusRdX PrRd/— BusRd/— BusRd/Flush BusRdX/Flush Replace/BusWB BusRdX/— Replace/—

The Cache Coherence Problem Processors see different values for u after event 3 With write back caches value written back to memory depends on which cache flushes or writes back value when processes accessing main memory may see very old value Unacceptable to programs

MSI Example P1 Cache P2P3 Bus Cache MEMORY BusRd Processor Action State in P1 State in P2State in P3Bus TransactionData Supplier S --- BusRdMemory P1 reads X X=10 S

P1 Cache P2P3 Bus Cache MEMORY X=10S Processor Action State in P1 State in P2State in P3Bus TransactionData Supplier S --- BusRdMemory P1 reads X P3 reads X BusRd X=10S S ---SBusRdMemory X=10

P1 Cache P2P3 Bus Cache MEMORY X=10S Processor Action State in P1 State in P2State in P3Bus TransactionData Supplier S --- BusRdMemory P1 reads X P3 reads X X=10 S S ---SBusRdMemory P3 writes X BusRdX ---I M I MBusRdX X=10 X=-25

P1 Cache P2P3 Bus Cache MEMORY Processor Action State in P1 State in P2State in P3Bus TransactionData Supplier S --- BusRdMemory P1 reads X P3 reads X X=-25M S ---SBusRdMemory P3 writes X ---I I MBusRdX P1 reads X BusRd X=-25 S S S ---SBusRdP3 Cache X=10X=-25

MESI Write-Back Invalidation Protocol To reduce two types of unnecessary bus transactions BusRdX that snoops and converts the block from S to M when only you are the sole owner of the block BusRd that gets the line in S state when there is no sharers (that lead to the overhead above) Introduce the Exclusive state One can write to the copy without generating BusRdX Illinois Protocol: Proposed by Pamarcos and Patel in 1984 Employed in Intel, PowerPC, MIPS

Four States: MESI M: Modified Only this cache has copy and is modified Main memory copy is stale E: Exclusive or exclusive-clean Only this cache has copy which is not modified Main memory is up-to-date S: Shared More than one cache may have copies, which are not modified Main memory is up-to-date I: Invalid

MESI State Transition Diagram Processor Read Causes a BusRd on a read miss BusRd(S) => shared line asserted Valid copy in another cache Goto state S BusRd(~S) => shared line not asserted No cache has this block Goto state E No bus transaction on a read hit PrWr/— PrRd/— E M I S PrRd PrRd/ BusRd(S) BusRdX/ Flush BusRd/— PrWr/ BusUpgr PrWr/ BusRdX BusRd/ Flush BusRdX or BusUpgr/— BusRdX/— PrRd/— BusRd/— PrRd/ BusRd(~S) PrWr/— Replace/ BusWB Replace/—

Processor Write Promotes block to state M Causes BusRdX / BusUpgr for states I / S To invalidate other copies No bus transaction for states E and M Cont..

Thank you!!