We discussed how MSI protocol works in previous post. However, in practice, other variants of MSI protocol are more commonly used. These includes:
MESI adds the state Exclusive to be basic MSI protocol, indicating “clean exclusive” state. As a comparison, M state indicates “dirty exclusive” or “modified exclusive” state.
If a cache block is in E state, it can be written without generating invalidates. Please refer to this link for more details for MESI state transition.
Wikipedia has a great explanations of advantages and disadvantages of MESI protocol. In a cache coherent system where different applications with minimal data sharing are running, MESI will be way faster than MSI.
In MESI, if contiguous writes and reads to the same cache block are performed by multiple caches in the system, then the data will be flushed on to system bus every time. Actually, this is what we have referred to as “coherence” conflict. In the meantime, main memory will be updated on every flush to keep clean state, introducing additional overhead to memory subsystem. This disadvantage can be overcome by MEOSI protocol.
MEOSI protocol adds Owned state to MESI protocol, indicating the cache block is owned by a cache and it is out-of-date in main memory. In MSI and MESI protocols, a sharing of a modified block requires the modified copy transits to shared state, and a write back to main memory. In MEOSI protocol, the cache block can be changed from modified to owned state in the original cache without writing back main memory. Later on, if there is a read request for this block, the original cache, instead of main memory, will supply the data.
The O state can be understood this way: “O” stands for “dirty forward” or “exclusive forward”; a cache block in “O” state is responsible to supply data and main memory does not have the latest copy.
You may wonder “O” stands for “dirty forward”, will there be a “clean forward”? Definitely! The “F” state in MEOFSI protocol, designate which sharing cache should respond to a request. In MSI / MESI protocol, a cache block read to a clean copy is always supplied by main memory; however, in MEOFSI protocol, main memory is not involved and performance of distributed memory system can be enhanced.
MESI protocol is a popular topic in interview questions, and it is a natural extension of MSI protocol we have discussed. Compared to MESI protocol, MEOSI and MEOFSI protocols are less frequently asked in hardware interviews. The basic requirement is to understand what “O” and “F” state stand for.
In next post, we will cover some basic implementation issues for home directory in snoop based scheme. Again, it is highly recommended to read J. Hennessy and D. Patterson’s book, Computer Architecture, Chapter 5 for more details.