wire / wire-format / mesi-protocol

MESI cache coherence protocol

MESI is a cache coherence protocol for multi-core systems. Four states: Modified (M): line is dirty and exclusive to this cache. Exclusive (E): line is clean and exclusive. Shared (S): line is clean and may be in other caches. Invalid (I): line is not valid. State transitions on read/write/hit/miss/snoop. Bus snooping: caches monitor (snoop) the bus for writes to shared lines.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: MESI cache coherence protocol

wire format

spec: MESI (cache coherence)

MESI is a cache coherence protocol for multi-core systems. Four states: Modified (M): line is dirty and exclusive to this cache. Exclusive (E): line is clean and exclusive. Shared (S): line is clean and may be in other caches. Invalid (I): line is not valid. State transitions on read/write/hit/miss/snoop. Bus snooping: caches monitor (snoop) the bus for writes to shared lines.

fieldsizemeaning
Modified (M)stateLine is dirty (modified) and exclusive to this cache. Must write back on eviction. No other cache has it.
Exclusive (E)stateLine is clean and exclusive to this cache. No other cache has it. Can transition to M on write (no bus transaction needed).
Shared (S)stateLine is clean and may be in other caches. Read-only. Must invalidate others on write (transition to M).
Invalid (I)stateLine is not valid. Must fetch from memory or another cache on access.
Read hit (M/E/S)transitionM: stay M. E: stay E. S: stay S.
Read miss (I)transitionI -> S (if other caches have it) or I -> E (if no other cache has it).
Write hit (M)transitionM: stay M.
Write hit (E)transitionE -> M (no bus transaction).
Write hit (S)transitionS -> M (invalidate other caches).
Write miss (I)transitionI -> M (fetch and invalidate others).
Snoop (read)transitionM -> S (write back first). E -> S. S: stay S.
Snoop (write)transitionM -> I (write back). E -> I. S -> I.

example:

00 00 00 00

MESI states (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/mesi-protocol or /wire-format/mesi-protocol.json