L5 & L6 & L7 Flashcards

1
Q

What is the simple (inefficient) solution to the cache coherency problem in multiprocessors?

A

Read/write to main memory but this negates the use of the cache

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

What are the 3 states for a cache line using the MSI protocol?

A

A cache has 2 control bits for each line:

Modified state: cache line is valid but memory does not have the updated values

Invalid: the data is not valid and must be fetched from memory

Shared: not invalid and not modified

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

What are the possible states for a dual-core CPU using the MSI protocol?

A

 Modified invalid
 Invalid invalid
 Invalid shared
 Shared shared

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

Why is there no modified shared state? and no modified modified state?

A

because the second core cannot share the out of sync version

because only one core can be modified

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

What are the state transitions for the Modified/Invalid state?

A
  • Read on core 1: cache hit
  • Write on core 1: cache hit
  • Read on core 2: changes to Shared/Shared
  • Write on core 2: changes to Invalid/Modified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the state transitions for the Invalid/Invalid state?

A
  • Read on core 1: fetches from memory, changes to Shared/Invalid
  • Write on core 1: Fetches from memory, changes to Modified/Invalid
  • Read on core 2: fetches from memory, changes to Invalid/Shared
  • Write on core 2: Fetches from memory, changes to Invalid/Modified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the state transitions for the Invalid/Shared state?

A
  • Read on core 1: 2 sends value to 1, changes to Shared/Shared
  • Write on core 1: changes to Modified/Invalid
  • Read on core 2: cache hit
  • Write on core 2: changes to Invalid/Modified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the state transitions for the Shared/Shared state?

A
  • Read on core 1: cache hit
  • Write on core 1: changes to Modified/Invalid
  • Read on core 2: cache hit
  • Write on core 2: changes to Invalid/Modified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 2 types of snooping protocols? Which is the more widespread protocol?

A

Write-invalidate: when a core updates a cache line, other copies of that line in other caches are invalidated

Write-update: when a core updates a cache line, other copies of that line are updated

Write-invalidate is more widespread because write-update leads to higher bus traffic

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

What are the two types of the Shared state? Why was this split made?

A

E: exclusive
 Switch to E after a read causing a fetch from memory

S: shared
 Switch to S after a read from another cache

This is done to distinguish when an invalidate request is necessary.

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

What is the Modified state split into?

A

Modified: not in sync with memory

Owned: not in sync with memory, other valid copies in S

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

Shared bus coherence does not scale well. What is a solution?

A

Directory centralising cache line information

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

What does each directory entry in directory-based coherence have?

A

Present bitmap

Dirty bit (only one owner)

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

Can the directory dirty bit be unset but the local dirty bit set?

A

No, because local dirty bit unset means the line is shared and there cannot be a unique owner.

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

Is using a central directory for directory based coherence optimal?

A

No, central directory is a serious bottleneck. A solution is to distribute directory and cache it.

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

What is an example of a distributed directory for directory based coherence?

A

NUMA (Non-uniform memory access) system, where each directory can access one socket. But, this results in slower communications.

17
Q

In a directory protocol, what happens when there is a read hit in the local cache?

A

simply read the value

18
Q

In a directory protocol, what happens when there is a read miss in the local cache?

A

If directory dirty bit is false:
o Get line from other cache or memory
o Set presence bit
o Set local valid bit

If directory dirty bit is true:
o Update memory and cache
o Clear directory dirty bit
o Set presence bit
o Set local valid bit

19
Q

In a directory protocol, what happens when there is a write hit in the local cache?

A

If local dirty bit is set: update the local cache

If local dirty bit is unset and directory dirty bit is false:
o Send invalidate to any cores with present bit set
o Set present bit
o Set directory dirty bit
o Set local dirty bit

20
Q

In a directory protocol, what happens when there is a write miss in the local cache?

A

If directory dirty bit is false
o Send invalidate to any cores with present bit set
o Set present bit
o Set directory dirty bit
o Set local dirty bit

If directory dirty bit is true:
o Owner core updates memory
o Clear owner’s present bit and set p[i] bit
o Set local dirty bit