I am learning cache coherency now, but I don't quite understand what's the function of Exclusive state in MESI protocol, as I think MSI is also work well.
Asked
Active
Viewed 3,300 times
1 Answers
8
The problem with the MSI protocol is that by default all data is loaded in the shared state even if it's not shared. When we move cache block X from the shared to the modified state we must send out a signal to the other caches to invalidate their copies of block X; if they don't have a copy of block X, then we needlessly waste bus bandwidth/cycles.
The common case of a program is to read and possibly modify data that is not shared with other threads. By introducing an exclusive state we have a way of distinguishing this non-shared (exclusive) data. We don't have to send out superfluous invalidate signals when we modify the majority of our data. MESI is functionally the same as MSI but is more optimised for the common case.

hayesti
- 2,993
- 2
- 23
- 34
-
I understand how MESI avoids the first unnecessary invalidate message. But, I don't see how this is a savings overall. Suppose C1 is requesting block B for the first time. In order for for C1 to mark that block Exclusive, doesn't it need to wait for acknowledgements from all the other caches that they don't also have a copy? – Zack Apr 05 '19 at 12:51
-
@Zack For that we have the L2 directory right? which tells us in which other caches the block is stored. If we see that the L2 cache directory is empty (for that block) then we just load the block in E state. – Turing101 Nov 28 '20 at 15:36
-
What directory? I thought that MSI/MESI were snooping protocols. – Zack Jan 06 '21 at 17:54