Cache Coherence Flashcards

1
Q

What is write-update coherence?

A

Broadcast writes to other cores and update their caches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is write-invalidate?

A

invalid other cores’ caches on a write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is cache snooping?

A

write broadcasts on a shared bus, the order of broadcasts on shared bus is the order the writes are updated in each cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is directory coherence?

A

each block is assigned an ‘ordering point’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does snooping ensure read/write order?

A

Cores must arbitrate broadcasts on the bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we reduce reads/writes to memory?

A

Add a dirty bit, update memory when the block is removed from the cache. A core with a dirty bit set responds to reads from other cores. Only 1 core can have a dirty bit set at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do we reduce writes to the bus?

A

Add shared bit to indicate if this block is stored in other caches. Add an extra bus line to signal if another cache has a block in the cache when another one reads/writes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the pros/cons of write-invalidate snooping?

A

(-) always have a miss on a read when other caches write

(+) after a write, all reads/writes are local to that cache until another cache performs a read/write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What type of coherence do most modern processors use and why?

A

Write-invalidate. Write-update has very bad performance when a thread is switched to another core (because it has to keep updating the old addresses)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the Invalid state?

A

block is not in the cache or block is in the cache with a valid bit == 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the Shared state?

A

Block is unmodified (may be in 1 or more caches) and contains the same data as memory. block can be read without updating other cores, but must notify other cores if a write occurs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the modified state?

A

There are no other copies of this block in other caches and it has changes to it. Can read and write to the block without sending any messages to other cores

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the ways to implement cache-to-cache transfers?

A
  1. Abort/retry - C1 aborts C2’s read request and writes block back to memory. C2 must try again later
  2. Intervention - C1 sends intervention signal to memory (“I will respond” and updates memory value). C1 responds to C2 with value
    For modified state!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the improvement of MOSI over MSI?

A

MSI and cache-to-cache transfers have a lot of writes to memory, MOSI looks to improve thiis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In MSI coherence, when does a cache respond to another cache’s read/write request?

A

Only during a read in the M state (shared state reads go to memory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the owner state and why was it introduced?

A

Avoids reads/writes to memory when we have the block in one of our caches. Responsible for giving data to other caches and for writing the block back to memory

17
Q

How do you get into the owner state?

A

When we are in the M state and see a read, we provide the data, but then we switch into O state (avoiding memory access)

18
Q

What is the drawback to MSI/MOSI?

A

It is less efficient for thread-private data. When we write, must send 2 bus signals (get data, put in M state)

19
Q

What is the exclusive state?

A

Don’t need to send reads/writes to the bus. But once we write, we put in M state (without sending to bus)

20
Q

What advantage does directory based coherence provide?

A

It scales better. The bus traffic needed for snooping becomes too large after 16 cores. Directory coherence is not broadcast based, so there is less contention

21
Q

Describe directory coherence

A

The directory is distributed across all the cores, with each core responsible for a different set of blocks. Each core must keep track of the state and which blocks have the data in a non-invalidated state

22
Q

What is a dirty bit in directory coherence?

A

Block is not necessarily dirty, if cache has exclusive access, then it can update the block without notifying the directory, so block will be marked as dirty in the directory

23
Q

How does a cache get a block in directory coherence?

A

Sends a request to the home slice. Directory sends data and state that the cache should be in

24
Q

What are the types of coherence misses?

A

False and true sharing. True sharing (two cores access the same data). False sharing (two cores access different data that is in the same block)