This is a great question about cache coherence protocols, specifically about the differences between MESI and MOESI. Let me explain the MOESI Owned state thoroughly.
Background: MESI Protocol States
First, let me review MESI:
- Modified (M): Cache has dirty data (modified), not in other caches
- Exclusive (E): Cache has clean data, not in other caches
- Shared (S): Cache has clean data, may be in other caches
- Invalid (I): Cache line is invalid
The Problem MOESI Solves
The key issue with MESI:
When a cache line is in Modified state (dirty), and another core requests it:
- The core with the modified line must write it back to memory
- The requesting core gets it from memory (now in Exclusive state)
- The original core transitions to Invalid
This is inefficient! The memory write is unnecessary because we're about to immediately read from memory. We could instead satisfy the request directly from the cache that has the dirty data.
MOESI Solution: The Owned State
MOESI adds a 5th state: Owned (O)
The five states are:
- Modified (M): Cache has dirty data, not in any other cache, AND is responsible for writing back to memory
- Owned (O): Cache has dirty data, BUT other caches may have clean copies of it. This cache is responsible for memory writeback
- Exclusive (E): Cache has clean data, not in other caches
- Shared (S): Cache has clean data, may be in other caches
- Invalid (I): Cache line is invalid
How Owned State Changes the Game
When a cache line is Owned:
-
The Owned cache holds the actual dirty data (most recent version)
-
Other caches can hold clean copies (Shared state)
-
The Owned cache is responsible for eventually writing to memory
-
Other caches don't need to worry about memory writeback - they rely on the Owner to handle it
Key Differences: MESI vs MOESI
MESI Scenario:
CPU1: Line in Modified state (dirty)
CPU2: Requests the line
MESI sequence:
1. CPU1's line is Modified - too bad, we need to flush to memory
2. CPU1 writes line to memory
3. CPU2 reads from memory (line becomes E in CPU2)
4. CPU1's line becomes Invalid
5. Memory is updated but was unnecessary until now
MOESI Scenario:
CPU1: Line in Modified state (dirty)
CPU2: Requests the line
MOESI sequence:
1. CPU1 transitions its line to Owned (still has dirty data)
2. CPU2 gets the line directly from CPU1's cache (becomes Shared)
3. CPU1 keeps the line and remains responsible for eventual writeback
4. No unnecessary memory traffic
The Owned state lets the cache holding dirty data share it directly with other cores while maintaining responsibility for the eventual memory update, eliminating wasteful writes in MESI.
State Transitions in MOESI
From Modified (M):
- Read/Write hit: stays M
- Snoop Read: M → O (send data to requester), other cache gets S
- Snoop Write/Invalidate: M → I (other cache gets M)
- Eviction: write back to memory, then invalid
From Owned (O):
- Read/Write hit: O stays O (or becomes M if write and sole owner)
- Snoop Read: O → O (send data), other cache gets S
- Snoop Write/Invalidate: O → I (other cache gets M)
- Eviction: write back to memory, then invalid
Benefits of Owned State
- Reduces memory bus traffic: Dirty data transfers directly between caches instead of flushing to memory unnecessarily
- Cache-to-cache transfers: Enables faster sharing of modified data
- Reduced latency: Avoids memory round trips
- Lower power: Memory controller stays less active
- Better for shared data: Handles the common pattern of one writer and many readers efficiently
Example Scenario
Initial state:
Memory address X has value 10
Time 1:
CPU1 reads X → L1 cache, state = E (exclusive, memory = 10)
Time 2:
CPU1 writes X → value changes to 20 → state = M (modified)
Time 3:
CPU2 reads X → (in MOESI protocol)
- CPU1 snoops this read request
- CPU1 recognizes the shared read and has dirty data
- CPU1 sends its modified data directly to CPU2
The Owned state lets me keep dirty data in cache while allowing other processors to read it without forcing a memory write first. When CPU1 transitions to Owned after sharing with CPU2, the data stays cached but CPU2 gets a Shared copy, avoiding unnecessary memory traffic while maintaining coherence. The Owned state defers memory writes until truly necessary—like cache eviction or power transitions—rather than forcing immediate writebacks when data is shared. This proves especially valuable for patterns like producer-consumer scenarios or read-heavy workloads where an L3 cache might hold data for multiple L2 caches.
MOESI's key advantage over MESI is its optimization for cache-to-cache transfers. By introducing the Owner state, MOESI reduces memory bus traffic significantly while MESI forces more frequent memory involvement. The tradeoff is added protocol complexity, but modern processors from Intel and AMD adopt similar approaches because the performance gains justify the extra sophistication.
MOESI Owned State: The Key Innovation
The MOESI States (5 states vs MESI's 4)
| State | Meaning | Other Copies Exist? | Writable? |
|---|
| Modified | Dirty, sole owner, responsible for writeback | No | Yes |
| Owned | Dirty, but others have clean copies, still responsible for writeback | Yes (Shared state) | Yes (local hits) |
| Exclusive | Clean, sole copy | No | No |
| Shared | Clean, copies may exist elsewhere | Yes | No |
| Invalid | Invalid | — | — |
MESI's Problem
CPU1: Line in Modified state (dirty data)
CPU2: Wants to read the line
MESI Protocol:
1. CPU1 must WRITE BACK to memory immediately
2. Memory receives data (unnecessary bus cycle)
3. CPU2 reads from memory
4. CPU1 invalidates its copy
❌ Problem: Eager writeback wastes memory bandwidth
MOESI's Solution: Owned State
CPU1: Line Modified (dirty)
CPU2: Wants to read the line
MOESI Protocol:
1. CPU1 snoops read request
2. CPU1 sends data DIRECTLY to CPU2 (cache-to-cache):
✓ CPU1: Modified → Owned (stays responsible for writeback)
✓ CPU2: Invalid → Shared (gets clean copy)
3. Memory write is DEFERRED
✓ Benefit: No unnecessary memory traffic
Why This Matters: Owned vs Modified
Modified State
- Sole owner of data
- Must writeback when invalidated
- No other caches have it
Owned State
- Still owns dirty data (most up-to-date)
- Still responsible for writeback (but delayed)
- Other caches have Shared copies (clean snapshots)
- Acts as a proxy to memory for other readers
Concrete Example: Producer-Consumer
Initial: x = 10 (in memory)
Step 1: CPU1 reads x
State: E (exclusive)
Step 2: CPU1 writes x = 20
State: M (modified, memory still has 10)
Step 3: CPU2 reads x
MESI:
→ CPU1 flushes 20 to memory (WRITE)
→ CPU2 reads from memory (READ)
→ Memory bus: 2 transactions ❌
MOESI:
→ CPU1 sends 20 directly to CPU2 (cache-transfer)
→ CPU1: M → O (still owns writeback duty)
→ CPU2: I → S (has clean copy)
→ Memory still has 10 (stale but safe)
→ Memory bus: 0 transactions ✓
Step 4: CPU1 evicted later
→ Now writeback 20 to memory (inevitable)
State Transitions Key to Owned
| Trigger | From M (Modified) | To | Other Cache Gets |
|---|
| Snoop Read | M | O (Owned) | S (Shared) |
| Snoop Write | M | I | M |
| Eviction | M | — | (writeback first) |
Performance Benefits
| Metric | MESI | MOESI |
|---|
| Memory writes on shared read | Yes (eager) | No (deferred) |
| Cache-to-cache transfers | Limited | Optimized |
| Transactions for shared reads | 2 (write + read) | 1 (cache transfer) |
| Memory bus traffic | Higher | Lower |
Real-World: Why Intel/AMD Use Similar Designs
Modern processors optimize this exact pattern:
- Hierarchical caches: L3 can "own" for multiple L2 caches
- Read-mostly workloads: Writers rarely change role
- NUMA systems: Distant nodes can share L3 data without memory roundtrip
The Owned state converts memory roundtrip latency into cache-to-cache latency (~12ns vs ~100ns on modern systems).