SlideShare a Scribd company logo
Cache Coherence
-by Priyam Pandey
Cache Coherence Problem
• Caches in multiprocessing environment
introduce the Cache Coherence problem.
• When multiple processors maintain locally
cached copies of a unique shared memory
location, any local modification of the location
can result in a globally inconsistent view of
memory. This is called Cache Coherence
Problem.
Cache Coherence
Cache Coherency Solutions
• Snoopy Bus Protocol :
A bus is a good medium for processors to observe ongoing
memory transactions. If a bus transaction creates
inconsistency of a locally cached object, cache controller can
take actions to invalidate the local copy. Such a protocol is
called Snoopy Bus Protocol
• Directory Schemes :
These protocols use a directory structure to keep track of
which processors are sharing each block of data.
Snoopy Bus Protocol
Two approaches are there to maintain cache
coherency –
• Write-Invalidate : When a processor modifies its
cache, all other cache copies are invalidated via the
bus.
• Write-Update : This protocol demands the updated
block content be broadcast to all cache copies via the
bus.
2 basic Write Invalidate snoopy protocols are-
Write Invalidate - Write Through : Multiple processors
can read block copies from main memory safely until one
processor updates its copy. At this time, all cache copies
are invalidated and the main memory is updated to
remain consistent.
Write Invalidate - Write Back : Whenever a shared
block is updated, main memory updates are done only
when the block is being replaced and all cache copies are
invalidated.
2 basic Write Update snoopy protocols are-
• Write Update – Write Through : Multiple
processors can read block copies from main memory
safely until one processor updates its copy. At this
time, all cache copies are updated as well as the
main memory is also updated to remain consistent.
• Write Update – Write Back : Whenever a shared
block is updated, all cache copies are updated and
main memory updates are done only when the block
is being replaced .
Protocol used by INTEL in Pentium to
avoid Cache Coherence
• MESI protocol is used by INTEL in Pentium. It
is an Invalidate based cache coherence
protocol that supports Write-Back caches.
• The letters of the protocol name identify the
possible states in which a cache can be -
MESI Protocol
• M: Modified
– Only this cache has copy and is modified.
– Main memory needs to be updated by this cache.
• E: Exclusive
– 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
-- It indicates that cache is invalid.
Exclusive - Only Cache 1 has a copy X which is
not modified.
Shared – More than one cache may have a
copy, here Cache 1and 3 are sharing a copy X
Modified – When the value at one local cache is
modified. Example here Cache 1 is modified.
Invalid – When the value at one location is
modified then that value in other cache is
invalidated. Example here Cache 3’s value is
considered invalid.
MESI PROTOCOL EXAMPLE
•In this this example, a 4 processor shared memory system
implements MESI Protocol.
•For following sequences of memory references,
state of line containing variable X in each
processor’s cache is resolved.

More Related Content

What's hot

Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
Memory organization
Memory organizationMemory organization
Memory organization
AL- AMIN
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
Gyanmanjari Institute Of Technology
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
Computer_ at_home
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
Ali Usman
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Adeel Rasheed
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
Kamal Acharya
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
Arpita Naik
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
Mohd Tariq
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
Gd Goenka University
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
Wayne Jones Jnr
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
Ravindra Raju Kolahalam
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Associative memory
Associative memoryAssociative memory
Associative memory
NancyBeaulah_R
 
Multiprocessor system
Multiprocessor system Multiprocessor system
Multiprocessor system
Mr. Vikram Singh Slathia
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
Neel Patel
 
Cache memory
Cache memoryCache memory
Cache memory
Ansari Maviya
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
Employee
 

What's hot (20)

Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Cache memory
Cache memoryCache memory
Cache memory
 
Associative memory
Associative memoryAssociative memory
Associative memory
 
Multiprocessor system
Multiprocessor system Multiprocessor system
Multiprocessor system
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 

Similar to Cache coherence

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
ssuser5c9d4b1
 
Snooping protocols 3
Snooping protocols 3Snooping protocols 3
Snooping protocols 3
Yasir Khan
 
Mesi
MesiMesi
Snooping 2
Snooping 2Snooping 2
Snooping 2
Yasir Khan
 
Cache Coherence.pptx
Cache Coherence.pptxCache Coherence.pptx
Cache Coherence.pptx
SamyakJain710491
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
Zena Abo-Altaheen
 
Week5
Week5Week5
Week5
student
 
Memory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdfMemory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdf
rajaratna4
 
12-6810-12.ppt
12-6810-12.ppt12-6810-12.ppt
12-6810-12.ppt
Lonewolf379705
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
ssusere16bd9
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
narendra kumar
 
Distributed system
Distributed systemDistributed system
Distributed system
Syed Zaid Irshad
 
22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
Kathirvel Ayyaswamy
 
cache memory and types of cache memory,
cache memory  and types of cache memory,cache memory  and types of cache memory,
cache memory and types of cache memory,
ashima967262
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchy
AJAL A J
 
Coherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architectureCoherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architecture
University of Pisa
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
Shyam Krishna Khadka
 
Lecture5
Lecture5Lecture5
Lecture5
Asad Abbas
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
Welly Dian Astika
 
Introduction 1
Introduction 1Introduction 1
Introduction 1
Yasir Khan
 

Similar to Cache coherence (20)

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Snooping protocols 3
Snooping protocols 3Snooping protocols 3
Snooping protocols 3
 
Mesi
MesiMesi
Mesi
 
Snooping 2
Snooping 2Snooping 2
Snooping 2
 
Cache Coherence.pptx
Cache Coherence.pptxCache Coherence.pptx
Cache Coherence.pptx
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
 
Week5
Week5Week5
Week5
 
Memory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdfMemory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdf
 
12-6810-12.ppt
12-6810-12.ppt12-6810-12.ppt
12-6810-12.ppt
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Distributed system
Distributed systemDistributed system
Distributed system
 
22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
 
cache memory and types of cache memory,
cache memory  and types of cache memory,cache memory  and types of cache memory,
cache memory and types of cache memory,
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchy
 
Coherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architectureCoherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architecture
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
Lecture5
Lecture5Lecture5
Lecture5
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Introduction 1
Introduction 1Introduction 1
Introduction 1
 

Recently uploaded

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 

Recently uploaded (20)

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 

Cache coherence

  • 2. Cache Coherence Problem • Caches in multiprocessing environment introduce the Cache Coherence problem. • When multiple processors maintain locally cached copies of a unique shared memory location, any local modification of the location can result in a globally inconsistent view of memory. This is called Cache Coherence Problem.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Cache Coherency Solutions • Snoopy Bus Protocol : A bus is a good medium for processors to observe ongoing memory transactions. If a bus transaction creates inconsistency of a locally cached object, cache controller can take actions to invalidate the local copy. Such a protocol is called Snoopy Bus Protocol • Directory Schemes : These protocols use a directory structure to keep track of which processors are sharing each block of data.
  • 9. Snoopy Bus Protocol Two approaches are there to maintain cache coherency – • Write-Invalidate : When a processor modifies its cache, all other cache copies are invalidated via the bus. • Write-Update : This protocol demands the updated block content be broadcast to all cache copies via the bus.
  • 10.
  • 11. 2 basic Write Invalidate snoopy protocols are- Write Invalidate - Write Through : Multiple processors can read block copies from main memory safely until one processor updates its copy. At this time, all cache copies are invalidated and the main memory is updated to remain consistent. Write Invalidate - Write Back : Whenever a shared block is updated, main memory updates are done only when the block is being replaced and all cache copies are invalidated.
  • 12.
  • 13. 2 basic Write Update snoopy protocols are- • Write Update – Write Through : Multiple processors can read block copies from main memory safely until one processor updates its copy. At this time, all cache copies are updated as well as the main memory is also updated to remain consistent. • Write Update – Write Back : Whenever a shared block is updated, all cache copies are updated and main memory updates are done only when the block is being replaced .
  • 14. Protocol used by INTEL in Pentium to avoid Cache Coherence • MESI protocol is used by INTEL in Pentium. It is an Invalidate based cache coherence protocol that supports Write-Back caches. • The letters of the protocol name identify the possible states in which a cache can be -
  • 15. MESI Protocol • M: Modified – Only this cache has copy and is modified. – Main memory needs to be updated by this cache. • E: Exclusive – 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 -- It indicates that cache is invalid.
  • 16. Exclusive - Only Cache 1 has a copy X which is not modified.
  • 17. Shared – More than one cache may have a copy, here Cache 1and 3 are sharing a copy X
  • 18. Modified – When the value at one local cache is modified. Example here Cache 1 is modified.
  • 19. Invalid – When the value at one location is modified then that value in other cache is invalidated. Example here Cache 3’s value is considered invalid.
  • 20. MESI PROTOCOL EXAMPLE •In this this example, a 4 processor shared memory system implements MESI Protocol. •For following sequences of memory references, state of line containing variable X in each processor’s cache is resolved.