Docsity

Cache Coherence in Multiprocessor Systems: Protocols and Techniques, Slides of Parallel Computing and Programming

Partial preview of the text

Download Cache Coherence in Multiprocessor Systems: Protocols and Techniques and more Slides Parallel Computing and Programming in PDF only on Docsity!

Cache Coherence : Single Processor

•^

Read Hit

-^

Read Miss ….. Get form memory

-^

Write Hit– Write through– Write back ( when cache block replacement if dirty)

-^

Write miss– Replace & write

Cache Coherence : Multiprocessor

•^

Read Hit………read & no action

-^

Read Miss ….. Get form other cache/ if not from memory

-^

Write Hit– Write invalidate (other caches)– Write update (other caches)

-^

Write miss– Replace & write

-^

For memory update– Single processor options of write through & write back applicable

Cache Coherence

in Multiprocessor Systems

Cache coherence in multiprocessor systems: (a) Invalidate protocol; (b)

Update protocol for shared variables.

When the value of a variable is changes, all its

copies must either be invalidated or updated.

(a) (b)

Invalidate

Memory

Memory

P

P

P

P

Update

Memory

Memory

P

P

P

P load

x

write

#3,

x

load

x

load

x

x^

=^

1

x^

=^

1

x^

=^

1

x^

=^

1

x^

=^

1

x^

=^

1

x^

=^

3

x^

=^

3

x^

=^

3

x^

=^

3

x^

=^

1

x^

=^

1

write

#3,

x

load

x

Cache Coherence:

Update and Invalidate Protocols

•^

If a processor just reads a value once and does not needit again, an update protocol may generate significantoverhead.

-^

If two processors make interleaved test and updates to avariable, an update protocol is better.

-^

Both protocols suffer from false sharing overheads (twowords that are not shared, however, they lie on the samecache line).

-^

Most current machines use invalidate protocols.

Multiprocessors Cache

Coherence protocols

MESI PROTOCOL •^

Pentium processor

•^

Snoopy

•^

Write Invalidate

•^

Write Back

•^

Snoopy based protocols

-^

Directory based protocols

MESI State Diagrams

•^

Initiating processor perspective

-^

Other processors perspective