Docsity

Directory Protocol - Parallel Processing Architectures - Lecture Slides, Slides of Parallel Computing and Programming

Partial preview of the text

Download Directory Protocol - Parallel Processing Architectures - Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Lecture 9:

Multiprocessor: Directory Protocol

Implementing Snooping Caches

• Bus serializes writes, getting bus ensures no one else can

perform memory operation

• On a miss from a cache, may have the desired copy or its

dirty in another cache, so must reply

• Most of the data can be potentially shared, but private

data are not shared – so why bother with maintaining

consistency? Can we detect by adding an extra state?

• Add 4th state (MESI) – See next transparency

Remote Read Place Data on Bus?

The MESI Protocol

Extensions:

– Fourth State:

Ownership

Remote Write or Miss due to address conflict Write back block

Remote Write or Miss due to address conflict Invalid

Shared (read/only)

Modified (read/write)

CPU Read hit

CPU Read

CPU Write Place Write Miss on bus

CPU Write

CPU read hit CPU write hit

Exclusive (read/only)

CPU Write Place Write Miss on Bus? CPU Read hit

Remote Read Write back block

  • Shared-> Modified, need invalidate only (upgrade request), don’t read memory Berkeley Protocol
  • Clean exclusive state (no miss for private data on write) MESI Protocol
  • Cache supplies data when shared state (no memory access) Illinois Protocol

Place read miss on bus

Place Write Miss on Bus

A Cache Coherent System Must:

  • Provide set of states, state transition diagram,

and actions

  • Manage coherence protocol
    • (0) Determine when to invoke coherence protocol
    • (a) Find info about state of block in other caches to

determine action

  • whether need to communicate with other cached copies
  • (b) Locate the other copies
  • (c) Communicate with those copies (inval/update)
  • (0) is done the same way on all systems
  • state of the line is maintained in the cache
  • protocol is invoked if an “access fault” occurs on

the line

  • Different approaches distinguished by (a) to (c)

Bus-based Coherence

• All of (a), (b), (c) done through broadcast on bus

  • faulting processor sends out a “search”
  • others respond to the search probe and take necessary

action

• Could do it in scalable network too

  • broadcast to all processors, and let them respond

• Conceptually simple, but broadcast doesn’t scale

with p

  • on bus, bus bandwidth doesn’t scale
  • on scalable network, every fault leads to at least p

network transactions

• Scalable coherence:

  • can have same cache states and state transition

diagram

  • different mechanisms to manage protocol

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.

Generic Solution: Directories

• Maintain state vector explicitly

– associate with memory block

– records state of block in each cache

• On miss, communicate with directory

– determine location of cached copies

– determine action to take

P

Cache Memory

Scalable Interconnection Network

Comm.Assist

P

Cache

CommAssist

Directory Directory Memory

Docsity.com

A Popular Middle Ground

• Two-level “hierarchy”

• Individual nodes are multiprocessors, connected

non-hiearchically

– e.g. mesh of SMPs

• Coherence across nodes is directory-based

– directory keeps track of nodes, not individual

processors

• Coherence within nodes is snooping or directory

– orthogonal, but needs a good interface of

functionality

• Examples:

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 Docsity.com

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: Docsity.com

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

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

Docsity.com