Docsity

Cache Coherence Protocols - Computer Systems Architecture - Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Cache Coherence Protocols - Computer Systems Architecture - Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Cache Coherence Protocols

in

Shared Memory Multiprocessors

Outline

  • Introduction
  • Background Information
    • The cache coherence problem
    • Cahce Enforcement Strategies
    • Consistency models
  • Simple Solutions
  • Hardware Protocols
    • Snooping protocols
    • Directory-based protocols
  • Compiler and Software protocols
  • Future work and conclusions

Cache Coherence Problem

Cache Coherence (cont.)

  • For correct execution, coherence must be enforced between the caches
  • Two major factors are:
    • performance
    • implementation cost
  • Four primary design issues are:
    • coherence detection strategy
    • coherence enforcement strategy
    • precision of block-sharing information
    • cache block size

Consistency Models

  • A consistency model defines how the

consistency of data values is maintained

  • Some consistency models are:
    • sequential consistency
    • weak consistency
    • release consistency
  • Weak consistency models are more efficient to

implement and require fewer coherence

messages

Shared Caches (1)

Processors share a single cache, essentially punting the problem.

- Useful for very small machines.

  • E.g., DPC in the Encore, Alliant FX/8.
  • Problems are limited cache bandwidth and cache interference
  • Benefits are fine-grain sharing and prefetch effects

Broadcast Writes (3)

  • Every cache write request is sent to all other

caches

  • Firstly need to discover whether each cache

hold this data

  • Other copies are either updated or invalidated
  • Significant additional memory transactions

occur

Hardware Protocols

  • Snoop Bus Mechanism
  • Directory Based Methods
    • Full Directory
    • Limited Directory
    • Chained Directory

MESI (4-state) Invalidation Protocol

  • Each line in the cache can be in one of 4 states
    • Modifed (exclusive) : only in 1 cache, modified
    • Exclusive (unmodified) : only in 1 cache, unmodified
    • Shared (unmodified)
    • Invalid

MESI State Transition Diagram

Directory-Based Protocols

  • Directory-based protocols do not rely on a shared bus to exchange coherence information (use point- to-point connections) - more scaleable (can have hundreds of processors) - each processor can have its own memory - implement weak consistency for efficiency

Directory-Based Protocols (cont.)

  • Each node maintains a directory storing cache information and memory information
  • A processor communicates with the directory to access memory - if a processor requests a non-local memory page, the directory uses its information to find the page - Then, it uses messages to retrieve the page and insure all other processors have consistent info. - Since the directory maintains which processors are caching the page, it only needs to send messages to those processors

Directory-Based Protocols (cont.)

  • Cache controller is hardware that maintains

the directory and processes memory requests

  • custom hardware
  • programmable protocol processor
  • The directory structure is how the cache and

memory information is organized

  • p+1-bit full directory
  • linked-list directories
  • tagged directories

Directory Models

  • Full Directory
    • Link to all caches for all shared locations
  • Limited Directory
    • To some caches having shared data, n < N
  • Chained (linked)Directory
    • To one chache, form ths cache to others, single/double link