Docsity

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

Partial preview of the text

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

Lecture 8:

Multiprocessor: Snooping Protocol,

Bus Snooping Topology

• Memory: centralized with uniform access

time (“uma”) and bus interconnect

• Examples: Sun Enterprise 5000 , SGI

Challenge, Intel SystemPro

Place read miss

on bus

Snoopy-Cache State Machine-III

  • State machinefor CPU requests for each

cache block and

for bus requests cache blockfor each

Invalid

Shared

(read/only)

Exclusive

(read/write)

CPU Read

CPU Write

CPU Read hit

Place Write

Miss on bus

CPU read miss

Write back block,

Place read miss

on bus CPU Write

Place Write Miss on Bus

CPU Read miss

Place read miss

on bus

CPU Write Miss

Write back cache block

Place write miss on bus

CPU read hit

CPU write hit

Cache Block

State

Write miss

for this block

Write Back

Block; (abort

memory

access)

Write miss

for this block

Read miss

for this block

Write Back

Block; (abort

memory access)

Example: Step 1

P1 P2 Bus Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr Value P1: Write 10 to A1 Excl. A1 10 WrMs P1 A P1: Read A P2: Read A

P2: Write 20 to A P2: Write 40 to A

Assumes initial cache state

is invalid and A1 and A2 map

to same cache block,

but A1 ≠ A2.

Active arrow = Remote

Write

or Miss

Write Back

Remote Write

or Miss

Invalid Shared

Exclusive

CPU Read hit

Read

miss on bus

Write

miss on bus CPU Write

Place Write

Miss on Bus

CPU read hit

CPU write hit

Remote Read

Write Back

P1 P2 Bus Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr Value P1: Write 10 to A1 Excl. A1 10 WrMs P1 A P1: Read A1 Excl. A1 10 P2: Read A

P2: Write 20 to A P2: Write 40 to A

Example: Step 2

Assumes initial cache state

is invalid and A1 and A2 map

to same cache block,

but A1 ≠ A

Remote

Write

or Miss

Write Back

Remote Write

or Miss

Invalid Shared

Exclusive

CPU Read hit

Read

miss on bus

Write

miss on bus CPU Write

Place Write

Miss on Bus

CPU read hit

CPU write hit

Remote Read

Write Back

Example: Step 4

P1 P2 Bus Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr Value P1: Write 10 to A1 Excl. A1 10 WrMs P1 A P1: Read A1 Excl. A1 10 P2: Read A1 Shar. A1 RdMs P2 A Shar. A1 10 WrBk P1 A1 10 10 Shar. A1 10 RdDa P2 A1 10 10 P2: Write 20 to A1 Inv. Excl. A1 20 WrMs P2 A1 10 P2: Write 40 to A2 10 10

Assumes initial cache state

is invalid and A1 and A2 map

to same cache block,

but A1 ≠ A

Remote

Write

or Miss

Write Back

Remote Write

or Miss

Invalid Shared

Exclusive

CPU Read hit

Read

miss on bus

Write

miss on bus CPU Write

Place Write

Miss on Bus

CPU read hit

CPU write hit

Remote Read

Write Back

A

Remote

Write

or Miss

Write Back

Remote Write

or Miss

Invalid Shared

Exclusive

CPU Read hit

Read

miss on bus

Write

miss on bus CPU Write

Place Write

Miss on Bus

CPU read hit

CPU write hit

Remote Read

Write Back

Example: Step 5

P1 P2 Bus Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr Value P1: Write 10 to A1 Excl. A1 10 WrMs P1 A P1: Read A1 Excl. A1 10 P2: Read A1 Shar. A1 RdMs P2 A Shar. A1 10 WrBk P1 A1 10 10 Shar. A1 10 RdDa P2 A1 10 10 P2: Write 20 to A1 Inv. Excl. A1 20 WrMs P2 A1 10 P2: Write 40 to A2 WrMs P2 A2 10 Excl. A2 40 WrBk P2 A1 20 20

A

A

Assumes initial cache state

is invalid and A1 and A2 map

to same cache block,

but A1 ≠ A

Implementing Snooping

Caches

  • Multiple processors must be on bus, access to both addresses and data
  • Add a few new commands to perform coherency,

in addition to read and write

  • Handling replacements – write back if in exclusive state and invalidate the

block in the cache

  • Processors continuously snoop on address bus
    • If address matches tag, either invalidate or update
  • Since every bus transaction checks cache tags,

could interfere with CPU just to check:

  • solution 1: duplicate set of tags for L1 caches just to allow checks in parallel with CPU
  • solution 2: L2 cache already duplicate, provided L2 obeys inclusion with L1 cache - block size, associativity of L2 affects L

Snooping Cache Variations

Berkeley

Protocol

Owned Exclusive

Owned Shared

Shared

Invalid

Basic

Protocol

Exclusive

Shared

Invalid

Illinois

Protocol

Private Dirty

Private Clean

Shared

Invalid

If read sourced from memory, then Private Clean

if read sourced from other cache, then Shared

Can write in cache if held private clean or dirty

MESI

Protocol

Modfied (private,!=Memory)

eXclusive (private,=Memory)

Shared (shared,=Memory)

Invalid

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

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

Distributed Directory MPs