Docsity

Understanding Cache Coherence and Snooping Protocols in Multiprocessor Systems, Slides of Computer Science

Toggle sidebar
bg1
Page 1
1
chapter 9
Parallel Processors
•Introduction of Multiprocessor Architecture
•more and more servers using multiprocessors
•Multiprocessor Taxonomy
•MIMD
•SIMD
•SISD
2
chapter 9
MIMD Alternatives
•MIMD
–centralized shared memory multiprocessor
–distributed shared memory multiprocessor
3
chapter 9
Centralized Shared Memory
•Bus-based multiprocessors
–multiple processors share a single memory
»UMA - uniform memory access
–Caches reduce the traffic requirements
–Bus interconnects processors, memory, I/O
CPU
$
CPU
$
memory I/O Devices
4
chapter 9
Cache Coherency Problem
•What happens if shared item is written ?
–old copies reside in cache of other processors
–stale data values are used
–need to eliminate old values when writing
x, y = 0
x <-- 1
.
.
x = x + y
CPU
$
x, y = 0
y <-- 1
.
.
x = x + y
CPU
$
memory I/O devices
Docsity.com
pf3
pf4

Partial preview of the text

Download Understanding Cache Coherence and Snooping Protocols in Multiprocessor Systems and more Slides Computer Science in PDF only on Docsity!

1 Page 1

chapter 9Parallel Processors^ •^ Introduction of Multiprocessor Architecture^ •^ more and more servers using multiprocessors^ •^ Multiprocessor Taxonomy^ •^ MIMD^ •^ SIMD^ •^ SISD

chapter 9MIMD Alternatives^ •^ MIMD^ –^ centralized shared memory multiprocessor^ –^ distributed shared memory multiprocessor

chapter 9Centralized Shared Memory^ •^ Bus-based multiprocessors^ –^ multiple processors share a single memory^ »^ UMA - uniform memory access^ –^ Caches reduce the traffic requirements^ –^ Bus interconnects processors, memory, I/OCPU $

CPU$ memory I/O Devices

chapter 9Cache Coherency Problem^ •^ What happens if shared item is written?^ –^ old copies reside in cache of other processors^ –^ stale data values are used^ –^ need to eliminate old values when writingx, y = 0CPUx <-- 1. .$x = x + y

x, y = 0CPUy <-- 1. .$x = x + y memory^ I/O devices

5 Page 2

chapter 9Snoopy Coherence Schemes^ •^ Invalidate all copies of a cache block when it is written;only single copy in writer’s cache in the system^ •^ How do you know if there is a copy?^ –^ snoop in cache on writes/cache misses, invalidatecopies^ –^ snooping limits scalability-misses must check allcachesx, y = 0CPUx <-- 1invalidate x$x = x + y

x, y = 0CPUy <-- 1invalidate y$y = x + y snooping path to cachememory^ I/O devices

chapter 9Single Bus Multiprocessor UsingSnooping Protocolprocessorsnoopcache tagtagand data memory^

processorprocessor.... .snoopcache tag.... .snoopcache tagtagand datatagand datasingle bus I/O 7

chapter 9Snooping Protocol •^ All cache controllers monitor or snoop on the bus todetermine whether or not they have a copy of theshared block •^ Snooping protocols are of two types :^ –^ write-invalidate: the writing processor invalidatesall copies in other caches before changing its localcopy; it is then free to update the local data untilanother processor asks for it^ –^ write-update: the writing processor broadcasts thenew data over the bus; all copies are then updatedwith the new value. This scheme is also calledwrite-broadcast •^ Write-update is like write through, all writes go over thebus to update copies of the shared data •^ Write-invalidate has similar benefits to write-back interms of reducing demands on bus bandwidth

chapter 9A Simple Cache Coherence Protocol^ •^ A write-invalidate protocol based on write-back policy^ •^ Each cache block is in one of three states:^ –^ Read only (clean) : The cache block is clean (notwritten) and may be shared^ –^ Read/Write (dirty) : The cache block is dirty (written)and is not shared^ –^ Invalid: This cache block does not have valid data

13 Page 4

chapter 9Commercial Shared-BusMultiprocessors^ •^ Use write-back cache because write-back reduces bustraffic and thereby allows more processors on a singlebus.^ •^ Use write-invalidate as the standard protocol.^ •^ Many processors have instructions such as cache lineflush, cache line load, etc to support cache coherenceprotocol (Pentium, Power PC, MIPS 10000 etc)