MESI & MOESI
MESI: Adding the Exclusive State
Section titled “MESI: Adding the Exclusive State”MESI adds a fourth state to MSI:
| State | Meaning | Dirty? | Shared? |
|---|---|---|---|
| M (Modified) | Only copy, modified | Yes | No |
| E (Exclusive) | Only copy, clean | No | No |
| S (Shared) | Clean, others may have copies | No | Yes |
| I (Invalid) | Not valid | — | — |
The Key Optimization
Section titled “The Key Optimization”When Core 0 reads a line and no other cache has it:
- MSI: goes to S → later write requires BusUpgr (bus transaction)
- MESI: goes to E → later write just transitions E→M silently (no bus transaction!)
This silent upgrade is a major performance win because many programs read data before writing it, and often only one core accesses a given line.
How Does the Cache Know?
Section titled “How Does the Cache Know?”On a BusRd, the bus has a SHARED signal. If any other cache asserts SHARED (they also have the line), the requesting cache goes to S. If nobody asserts SHARED, it goes to E.
Interactive: Cache State Transitions
Section titled “Interactive: Cache State Transitions”Click Read/Write on each core to see MSI and MESI state transitions in action. Watch how the states change and how they coordinate:
MOESI: Adding the Owned State
Section titled “MOESI: Adding the Owned State”MOESI adds a fifth state:
| State | Meaning |
|---|---|
| O (Owned) | This cache has the authoritative copy, but others have S copies. Memory is stale. |
Why Owned?
Section titled “Why Owned?”In MESI, when Core 0 has a line in M and Core 1 reads it:
- Core 0 flushes the dirty data to memory (expensive write)
- Both caches go to S
In MOESI:
- Core 0 supplies the data directly to Core 1 (cache-to-cache transfer)
- Core 0 goes to O (responsible for the data), Core 1 goes to S
- Memory is not updated — saved a memory write!
The O state means “I’m the owner; if anyone needs this data, I’ll supply it. Memory is stale.”
MOESI Summary
Section titled “MOESI Summary”| State | Only copy? | Dirty? | Responsible for writeback? |
|---|---|---|---|
| M | Yes | Yes | Yes (on eviction) |
| O | No (others in S) | Yes | Yes (on eviction) |
| E | Yes | No | No |
| S | No | No | No |
| I | — | — | — |
Real-World Usage
Section titled “Real-World Usage”| Protocol | Used by |
|---|---|
| MESI | Intel (with extensions), many embedded |
| MOESI | AMD (with extensions) |
| MESIF | Intel server (F = Forward, similar role to O) |
All real implementations add vendor-specific extensions, but the core state machine is recognizable from these standard protocols.