Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Path
  • Cache Coherency Glossary
  • The Shared Course Model
  • Cache Coherency Revision Sheet
  • Why Coherence Exists8
    • Caches and Shared Data
    • Permissions and Values
      • Permission Versus Data
      • Who Has the Newest Data?
      • Dirty Responsibility
      • Epochs and Serialization
  • States and Protocols12
  • Transactions12
  • Races and Controller Design8
  • Progress and the Fabric16
  • Ordering and Synchronization12
  • Performance and Scalability12
  • Real Protocols12
  • SoC Integration12
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Permissions and Values
  1. Topics
  2. Cache Coherency
  3. Why Coherence Exists
  4. Permissions and Values
  5. Who Has the Newest Data?

Part 1 · Why Coherence Exists · All levels

Who Has the Newest Data?

Follow a MESI dirty read from C0's M copy, through H and memory, to two clean sharers.

On this page

    Where is the newest value at each step?

    A directory tracks permission and routing information; it need not contain a live copy of every private-cache value. Start with the previous lesson's distinction between usable data and write permission. The useful debugging question is not simply 'what is in memory?' It is 'which copies, buffers or in-flight messages hold the newest value for this line now?'

    Start from the warm snapshot of Caches, Lines and Write-Back: a cold MESI read granted C0 E / 0 and a silent local store made it M / 1. H still records exclusive(C0) and memory = 0. Because the E-to-M store was silent, H cannot answer C1 from memory; it forwards the request to the exclusive holder. gem5's MESI Two Level documentation describes the same E optimisation.

    A dirty read under MESI

    C1 now loads X. H forwards the request to C0 as Fwd-GetS; C0 downgrades M to S and sends its value to H; H writes memory and then grants S to C1. Each numbered arrow is a delivery and each row the snapshot afterwards; the memory write at H is a note, not a message.

    C1 asks H for X, H forwards to C0, C0 downgrades to S and sends one to H, H writes one to memory and grants C1 S with value one.
    MESI dirty read on the course model: four delivered messages and one memory write at H.

    Step

    C0 state / value

    C1 state / value

    H directory

    Memory

    Newest data

    0. Warm start

    M / 1

    I / -

    exclusive(C0)

    0

    C0: 1

    1. GetS at H

    M / 1

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0: 1

    2. Fwd-GetS at C0

    S / 1

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0: 1, Data(1) in flight to H

    3. Data at H

    S / 1

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0 and H buffer: 1

    H writes memory

    S / 1

    IS^D / -

    S{C0}, pend GetS C1

    1

    C0 and memory: 1, Data(1) in flight to C1

    4. Data at C1

    S / 1

    S / 1

    S{C0}, pend GetS C1

    1

    C0, C1 and memory: 1

    (assumed) grant delivered

    S / 1

    S / 1

    S{C0,C1}

    1

    C0, C1 and memory: 1

    Follow the value, not the letters

    Read the last column from top to bottom. The newest value 1 starts only in C0's cache. At step 2 C0 keeps a read-only copy and a second copy leaves in Data(1); for that interval the message is one of the places holding 1. At step 3 the payload sits in H's buffer. H then writes memory, so memory becomes current again, and step 4 installs a third copy at C1. The transaction ends S / 1, S / 1 with memory = 1: a stable MSI or MESI read epoch in which every usable copy agrees and memory can serve the next reader.

    The directory changes at different moments from the value. exclusive(C0) stays recorded while the request is pending; H drops C0's exclusive record only when it has written C0's Data to memory (S claims memory is current), and adds C1 to the sharers only in the '(assumed) grant delivered' row, after C1 has received its grant. Many directory protocols, including the Primer's, let C0 send Data to C1 and H in parallel; this course routes it through H so that one node sees every step.

    Common pitfall

    Do not settle a MESI dirty read at S / 1, S / 1 with memory = 0. No cache would be dirty-responsible, so if both later evicted their clean S copies with PutS, the value 1 would be lost. MOESI solves the same problem differently, by keeping C0 responsible in O.

    Check yourself At step 2, where is the newest value 1, and who may write it?

    In C0's S copy and in the Data(1) message in flight to H. Memory still holds 0. Nobody may write: C0 gave up write permission when it moved from M to S, and C1 has no permission yet. The in-flight message must not be dropped, because memory has not yet been updated.

    Interview

    When asked where the newest value lives, give the step and every location that holds it, including messages in flight and H's buffer. Then explain how the requester is authorised to obtain it. A payload, a directory pointer and a permission grant are distinct pieces of evidence.

    Related topics

    • Course Model

    • Permission Versus Data

    • Next: Dirty Responsibility

    Previous

    11 / 167

    Next: Dirty Responsibility

    Up next

    Up nextDirty Responsibility

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Epochs and Serialization