









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Lecture 20 Architecture of Parallel Computers 1
[§8.1] All of the cache-coherent systems we have talked about until now have had a bus.
Not only does the bus guarantee serialization of transactions; it also serves as convenient broadcast mechanism to assure that each transaction is propagated to all other processors’ caches.
Now we want to consider how cache coherence can be provided on a machine with physically distributed memory and no globally snoopable interconnect.
These machines provide a shared address space.
They must be able to satisfy a cache miss transparently from local or remote memory. This replicates data. How can it be kept coherent?
Scalable network
CA
P
$
Switch
M
Switch Switch
Scalable distributed memory machines consist of P-C-M nodes connected by a network.
The communication assist interprets network transactions and forms the interface between the processor and the network.
© 2002 Edward F. Gehringer CSC/ECE 506 Lecture Notes, Spring 2002 2
A coherent system must do these things.
Provide set of states, state-transition diagram, and actions. Manage coherence protocol. (0) Determine when to invoke the coherence protocol (a) Find source of info about state of this block in other caches.
(b) Find out where the other copies are (c) Communicate with those copies (invalidate/update)
(0) is done the same way on all systems
The different approaches to scalable cache coherence are distinguished by their approach to (a), (b), and (c).
Bus-based coherence
In a bus-based coherence scheme, all of (a), (b), and (c) are done through broadcast on bus.
We could do this in a scalable network too—broadcast to all processors, and let them respond. Why don’t we?
Why not?
© 2002 Edward F. Gehringer CSC/ECE 506 Lecture Notes, Spring 2002 4
Let us start off by considering a simple directory-based approach due to Tang (1976). It uses—
Until a block is modified, it can be cached in any number of places. Once it is modified, only one cached copy is allowed to exist until it is written back to main memory.
Here is a diagram of the three tables:
L [ k , 0]
Local flagsValid flags
L [ k , 1]
Local flagsValid flags Local flagsValid flags
…
Cache line containing block k Cache number 0 1 n^ –
Block 0
Block i
Block N –
P [ i , 0] P [ i , 1] (^) P [ i , n –1]
…
…
Present table Modified table
M [ i ]
Lecture 20 Architecture of Parallel Computers 5
A cached block can be in one of three states:
When a processor writes a block, it changes its status to RW, and invalidates the other cached copies if its previous status was RO.
Here is a flowchart of the coherence checks on a read reference:
Lecture 20 Architecture of Parallel Computers 7
Operation of a simple directory scheme
The scheme we have just discussed is called a centralized directory scheme , because the directory is kept together in one place.
Let us now assume that the directory is distributed, with each node holding directory information for the blocks it contains.
This node is called the home node for these blocks.
PI
EX
RO
RW
Yes, one RW copy in cache r.
GT
GT, WB
No
No
Yes
Yes
Store into block i in local cache c.
Hit?
Find block j to replace If block j is RW, MM block[ j , c ]
Other cop- ies of block i?
Invalidate all copies of block i in other caches
Write block i back to MM and invalidate it in cache r.
Fetch block i with RW access.
Store block in cache c.
End
Block i status in cache (L[ i , c ])?
Invalidate all copies of block i in other caches
Record block i as RW in GT.
GT: Possible access to global table WB: Possible write-back to memory PI: Pure invalidation MM: Main memory
© 2002 Edward F. Gehringer CSC/ECE 506 Lecture Notes, Spring 2002 8
What happens on a read-miss?
P
A M/D
C
P
A M/D
C
P
A M/D
C
Read request to directory
Reply with owner identity Read req. to owner Data Reply
Revision message to directory
4a.
4b.
Requestor
Node with dirty (^) copy
Directory (^) node for block
The requesting node sends a request transaction over the network to the home node.
The home node responds with the identity of the owner —the node that currently holds a valid copy of the block.
The requesting node then gets the data from the owner, and revises the directory entry accordingly.
On a write- miss, the directory identifies copies of the block, and invali- dation or update messages may be sent to the copies.
P
A M/D
C P
A M/D
C
P
A M/D
C
RdEx request to directory
Reply with sharers identity
Inval. req. to sharer
P
A M/D
C
Inval. req. to sharer
Inval. ack Inval. ack
3a. 3b.
4a. 4b.
Requestor
Directory (^) node
Sharer Sharer
© 2002 Edward F. Gehringer CSC/ECE 506 Lecture Notes, Spring 2002 10
On the replacement of a dirty block by node i , the data is written back to memory and the directory is updated to turn off dirty bit and p [ i ].
On the replacement of a shared block, the directory may or may not be updated.
How does a directory help? It keeps track of which nodes have copies of a block, eliminating the need for
Would directories be valuable if most data were shared by most of the nodes in the system?
Fortunately, the number of valid copies of data on most writes is small.
Scaling with number of processors
[§8.2.2] • Scaling of memory and directory bandwidth provided
Centralized directory is bandwidth bottleneck, just like centralized memory. How to maintain directory information in distributed way?
Lecture 20 Architecture of Parallel Computers 11
How a directory is organized affects all these, performance at a target scale, as well as coherence-management issues.
Alternatives for organizing directories
[§8.2.3] When a miss occurs, how do we find the directory information? There are two main alternatives.
Centralized Distributed
Flat Hierarchical
Memory-based Cache-based
Directory Schemes
How to find source of directory information
How to locate copies
Lecture 20 Architecture of Parallel Computers 13
Organizing a memory-based directory scheme
All info about copies is colocated with the block itself at the home
They work just like centralized scheme, except for being distributed.
Scaling of performance characteristics
P
M
Scaling of storage overhead? Assume representation is a full bit- vector.
Optimizations for full bit-vector schemes
► Reducing “width”: addressing the p term
© 2002 Edward F. Gehringer CSC/ECE 506 Lecture Notes, Spring 2002 14
► Reducing “height”: addressing the m term.
Organizing a cache-based directory scheme.
In a cache-based scheme, home only holds a pointer to the rest of the directory information.
The copies are lined together via a distributed list that weaves through caches.
Each cache tag has a pointer that points to the next cache with a copy.
Disadvantages: All operations require communicating with at least three nodes (node that is being operated on, previous node, and next node).
Write latency is proportional to number of sharers.
Synchronization is needed
Advantages: Directory overhead is small. Linked list records order that accesses were made, making it easier to avoid starvation.