תרגול מס' 5: MESI Protocol

Slides:



Advertisements
Similar presentations
The University of Adelaide, School of Computer Science
Advertisements

Extra Cache Coherence Examples In the following examples there are a couple questions. You can answer these for practice by ing Colin at
MESI cache coherence protocol
Multi-core systems System Architecture COMP25212 Daniel Goodman Advanced Processor Technologies Group.
1 Lecture 4: Directory Protocols Topics: directory-based cache coherence implementations.
Cache Optimization Summary
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Snoopy Caches II Steve Ko Computer Sciences and Engineering University at Buffalo.
Technical University of Lodz Department of Microelectronics and Computer Science Elements of high performance microprocessor architecture Shared-memory.
CIS629 Coherence 1 Cache Coherence: Snooping Protocol, Directory Protocol Some of these slides courtesty of David Patterson and David Culler.
Computer Architecture 2011 – coherency & consistency (lec 7) 1 Computer Architecture Memory Coherency & Consistency By Dan Tsafrir, 11/4/2011 Presentation.
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.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Nov 14, 2005 Topic: Cache Coherence.
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.
Shared Address Space Computing: Hardware Issues Alistair Rendell See Chapter 2 of Lin and Synder, Chapter 2 of Grama, Gupta, Karypis and Kumar, and also.
Computer Architecture 2015 – Cache Coherency & Consistency 1 Computer Architecture Memory Coherency & Consistency By Yoav Etsion and Dan Tsafrir Presentation.
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.
Cache Coherence Protocols A. Jantsch / Z. Lu / I. Sander.
CIS 720 Distributed Shared Memory. Shared Memory Shared memory programs are easier to write Multiprocessor systems Message passing systems: - no physically.
1 Lecture: Coherence Protocols Topics: snooping-based protocols.
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
Multi Processing prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University June 2016Multi Processing1.
1 Lecture 8: Snooping and Directory Protocols Topics: 4/5-state snooping protocols, split-transaction implementation details, directory implementations.
Outline Introduction (Sec. 5.1)
Lecture 8: Snooping and Directory Protocols
COSC6385 Advanced Computer Architecture
COMP 740: Computer Architecture and Implementation
Cache Organization of Pentium
Replacement Policy Replacement policy:
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
CS 704 Advanced Computer Architecture
A Study on Snoop-Based Cache Coherence Protocols
Cache Coherence for Shared Memory Multiprocessors
12.4 Memory Organization in Multiprocessor Systems
Multiprocessor Cache Coherency
Jason F. Cantin, Mikko H. Lipasti, and James E. Smith
The University of Adelaide, School of Computer Science
Example Cache Coherence Problem
The University of Adelaide, School of Computer Science
Cache Coherence Protocols:
Cache Coherence Protocols:
Cache Coherence (controllers snoop on bus transactions)
Lecture 2: Snooping-Based Coherence
Chip-Multiprocessor.
CMSC 611: Advanced Computer Architecture
Lecture 5: Snooping Protocol Design Issues
Multiprocessor Highlights
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Distributed Shared Memory
Lecture 9: Directory-Based Examples
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
Lecture 17 Multiprocessors and Thread-Level Parallelism
Cache coherence CEG 4131 Computer Architecture III
Lecture 24: Multiprocessors
Coherent caches Adapted from a lecture by Ian Watson, University of Machester.
Lecture 17 Multiprocessors and Thread-Level Parallelism
A. T. Clements, M. F. Kaashoek, N. Zeldovich, R. T. Morris, and E
The University of Adelaide, School of Computer Science
CSE 486/586 Distributed Systems Cache Coherence
Lecture 17 Multiprocessors and Thread-Level Parallelism
Presentation transcript:

תרגול מס' 5: MESI Protocol מבנה מחשבים ספרתיים 234267 תרגול מס' 5: MESI Protocol 1

Multi-processor System A memory system is coherent if If P1 writes to address X, and later on P2 reads X, and there are no other writes to X in between  P2’s read returns the value written by P1’s write Writes to the same location are serialized: two writes to location X are seen in the same order by all processors Processor 1 L1 cache Processor 2 L2 cache (shared) Memory 2

MESI Protocol Each cache line can be in one of 4 states Invalid – Line’s data is not valid Shared – Line is valid and not dirty, copies may exist in other processors Exclusive – Line is valid and not dirty, other processors do not have the line in their local caches Modified – Line is valid and dirty, other processors do not have the line in their local caches 3

Copies may exist in other processors MESI Protocol States State Valid Modified Copies may exist in other processors Invalid No N.A. N.A Shared Yes Exclusive To modify a line it mustn’t exist in other processors Otherwise, another processor which has the line will be using stale data Therefore, before modifying a line, a processor must request ownership of the line 4

Multi-processor System: Example P1 reads 1000 P1 writes 1000 Processor 1 L1 cache Processor 2 L2 cache (shared) Memory [1000] [1000]: 6 miss M E [1000]: 5 00 10 miss [1000]: 5 [1000]: 5 5

Multi-processor System: Example P1 reads 1000 P1 writes 1000 P2 reads 1000 L2 snoops 1000 P1 writes back 1000 P2 gets 1000 Processor 1 L1 cache Processor 2 L2 cache (shared) Memory [1000] [1000]: 6 [1000]: 6 S M miss S [1000]: 6 [1000]: 5 11 10 [1000]: 5 6

Multi-processor System: Example P1 reads 1000 P1 writes 1000 P2 reads 1000 L2 snoops 1000 P1 writes back 1000 P2 gets 1000 Processor 1 L1 cache Processor 2 L2 cache (shared) Memory [1000]: 6 [1000]: 6 [1000]: 6 [1000] I M S E S [1000] [1000]: 6 01 11 10 [1000]: 5 P2 requests for ownership with write intent 7

Core Valid Bits and Inclusion L2 keeps track of the presence of each line in each of the cores’ L1 caches Determine if it needs to send a snoop to a processor Determine in what state to provide a requested line (S,E) Maintain Core Valid Bits (CVB) per cache line Need to guarantee that the L1 caches in each core are contained in the L2 cache When L2 evicts a line L2 sends a snoop invalidate to all processors that have it If the line is modified in the L1 cache of one of the processors (in which case it exists only in that processor) The processor responds by sending the updated value to L2 When the line is evicted from L2, the updated value gets written to memory 8

MESI Protocol Example A four-processor shared-memory system implements MESI protocol For the following sequence of memory references, show the state of the line containing the variable X in each processor’s cache after each reference is resolved All processors start out with the line containing X invalid in their cache   P0’s state P1’s state P2’s state P3’s state CVBs Initial State I 0000 P0 reads X P1 reads X P2 reads X P3 writes X E I 1000 S I 1100 S I 1110 I M 0001 S I 1001 9