what is the difference btw migration and replication in cache coherence

Viewed 399

In "Computer Organization and Design, RISC-V ed.", for part of "Basic Schemes for Enforcing Coherence", I'm confused with two concepts, migration and replication.

The given definitions of two are like this:

In a cache-coherent multiprocessor, the caches provide both migration and replication of shared data items:

  1. Migration: A data item can be moved to a local cache and used there in a transparent fashion. Migration reduces both the latency to access a shared data item that is allocated remotely and the bandwidth demand on the shared memory.

  2. Replication: When shared data are being simultaneously read, the caches make a copy of the data item in the local cache. Replication reduces both latency of access and contention for a read shared data item.

Supporting migration and replication is critical to performance in accessing shared data, so many multiprocessors introduce a hardware protocol to maintain coherent caches.

I think replication is quite familiar in the cache system but, I cannot figure out how migration works.

1 Answers

Migration and replication of shared data are two ways in which caches can be beneficial.

  1. Migration: Let's say processing unit A wants do a lot of operations a shared data item. This data item might be located in memory attached to processing unit B, or in some kind of faraway shared memory. Accessing this item would therefore be slow. To solve this problem, we migrate/move said item to a local cache attached to A, where we can access it much more quickly, and without load on the shared memory. This is a benefit of caching we have in single-processor systems as well.
  2. Replication: This is only relevant in a multiprocessor context. Let's say processing units A and B simultaneously want to access data in shared memory. Since both requests can't be served at once, one of the two has to wait for the other request to complete, introducing additional latency. If instead this data was replicated/copied to a local cache at A and/or B, they would not have to contend for the shared memory resources, because one or both could instead access their own local copy.

Migration means moving data to a local cache because it's faster than the shared or remote memory.

Replication means having local copies of data for multiple processing units, so that they don't have to contend for access to shared memory.

Related