Skip to content

MSI Protocol

Each cache line is in exactly one of three states:

StateMeaningCan read?Can write?Memory up-to-date?
M (Modified)This cache has the only valid copy; it’s been writtenYesYesNo (cache has newer data)
S (Shared)Clean copy; other caches may also have copiesYesNo (must upgrade first)Yes
I (Invalid)Not in cache or staleNoNo
Current StateActionNext State
MRead hitM
SRead hitS
I (miss)Issue BusRd; if another cache has M, it flushes → both go SS
Current StateActionNext State
MWrite hitM
SIssue BusUpgr → invalidate other sharersM
I (miss)Issue BusRdX → get line, invalidate othersM
Observed SignalMy StateActionMy New State
BusRdMFlush data to bus + memoryS
BusRdSNo actionS
BusRdX / BusUpgrMFlush data to bus + memoryI
BusRdX / BusUpgrSI

At any time, for any cache line, exactly one of these is true:

  • One cache holds the line in M, and all others are I
  • Multiple caches hold the line in S (and memory is up-to-date)
  • All caches are I (nobody has the line)

This invariant is what guarantees coherence: there’s never a situation where two caches have conflicting data.

MSI has an inefficiency: when a cache reads a line that nobody else has, it goes to S even though it’s the only copy. If it later writes to that line, it must first issue a BusUpgr (unnecessary bus traffic). The MESI protocol fixes this with an Exclusive state.