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
  • States and Protocols12
  • Transactions12
  • Races and Controller Design8
  • Progress and the Fabric16
  • Ordering and Synchronization12
  • Performance and Scalability12
  • Real Protocols12
  • SoC Integration12
    • LLC Data and Directory Policies
      • Inclusive, Exclusive and Non-Inclusive
      • Back-Invalidation
      • The LLC as Directory
      • Policy Trade-Offs
    • Devices and DMA
    • The Memory-Controller Boundary
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹LLC Data and Directory Policies
  1. Topics
  2. Cache Coherency
  3. SoC Integration
  4. LLC Data and Directory Policies
  5. Policy Trade-Offs

Part 9 · SoC Integration · All levels

Policy Trade-Offs

Unique capacity, snoop filtering, duplication and bandwidth for inclusive, exclusive and NINE LLCs.

On this page

    Which LLC policy is better for this workload?

    Unique capacity is the number of distinct lines the private caches and the LLC can hold together. The three policies trade it against snoop filtering and bandwidth:

    Policy

    Unique capacity

    Snoop filtering

    Costs

    Good fit

    Inclusive

    About the LLC size: every private line is duplicated in the LLC

    Free: an LLC tag miss proves no private copy

    Duplication, back-invalidation on LLC eviction, inclusion victims

    LLC much larger than total private capacity, so duplication wastes little

    Exclusive

    About total private capacity + LLC size

    None from the LLC: needs a separate snoop filter

    Every private eviction, clean ones too, costs an LLC fill (data-carrying clean eviction)

    LLC not much larger than total private capacity, where duplication would waste a large share

    NINE

    Between the two, depending on how much is duplicated

    None from the LLC: needs a separate snoop filter

    No back-invalidation from LLC data evictions, but the filter's evictions can still back-invalidate

    Designers want to drop LLC lines freely without disturbing private caches

    Unique capacity (illustrative)

    Illustrative sizes, not a measured design: two private caches of 256 KiB each and a 1 MiB LLC. Inclusive gives about 1 MiB of unique data, exclusive about 1.5 MiB. The relative gap is total private capacity divided by LLC size, so it shrinks as the LLC grows relative to the private caches. The check also counts LLC fills per private eviction.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    KiB = 1024
    MiB = 1024 * KiB
    
    def unique_capacity(policy, n_private, private, llc):
        total_private = n_private * private
        if policy == "inclusive":
            if llc < total_private:
                raise ValueError("inclusive LLC smaller than total private capacity")
            return llc
        if policy == "exclusive":
            return total_private + llc
        if policy == "nine":
            return (max(llc, total_private), total_private + llc)
        raise ValueError(policy)
    
    def llc_fills(policy, clean_evictions, dirty_evictions):
        if policy == "exclusive":
            return clean_evictions + dirty_evictions
        return dirty_evictions
    
    incl = unique_capacity("inclusive", 2, 256 * KiB, 1 * MiB)
    excl = unique_capacity("exclusive", 2, 256 * KiB, 1 * MiB)
    assert incl == 1 * MiB and excl == 1.5 * MiB
    low, high = unique_capacity("nine", 2, 256 * KiB, 1 * MiB)
    assert incl <= low <= high == excl
    
    naive_inclusive = 2 * 256 * KiB + 1 * MiB
    assert naive_inclusive != incl
    
    gaps = []
    for llc in (1 * MiB, 2 * MiB, 4 * MiB, 8 * MiB):
        a = unique_capacity("inclusive", 2, 256 * KiB, llc)
        b = unique_capacity("exclusive", 2, 256 * KiB, llc)
        gaps.append((b - a) / a)
    assert gaps == sorted(gaps, reverse=True) and gaps[0] == 0.5 and gaps[-1] == 0.0625
    
    try:
        unique_capacity("inclusive", 2, 256 * KiB, 256 * KiB)
        raise AssertionError("inclusion cannot hold with a smaller LLC")
    except ValueError:
        pass
    
    assert llc_fills("exclusive", 80, 20) == 100
    assert llc_fills("inclusive", 80, 20) == 20
    assert llc_fills("nine", 80, 20) == 20
    print("PASS: inclusive 1 MiB vs exclusive 1.5 MiB, gap shrinks as LLC-to-private ratio grows")

    Workload matters on top of capacity. A line read by both cores occupies two private entries under every policy, so exclusive does not remove that duplication. A streaming workload that touches each line once fills an exclusive LLC with clean victims nobody rereads, paying LLC fill bandwidth for nothing. A small hot working set that hits in L1 exposes an inclusive LLC to inclusion victims. When comparing policies, keep line size, private capacities and the workload fixed, and count the snoop filter's storage against exclusive and NINE.

    If the LLC is much larger than the private caches, choose inclusive. Otherwise, with a separate snoop filter, choose exclusive when evicted lines are reread soon and NINE when they are not.
    A rule of thumb from the trade-off table, not a universal ranking.

    Common pitfall

    Adding private and LLC capacities for an inclusive design. With 2 x 256 KiB private and a 1 MiB LLC the inclusive unique capacity is 1 MiB, not 1.5 MiB.

    Interview

    State the capacity ratio first (total private versus LLC), then the snoop-filter cost, then the bandwidth cost of exclusive's clean-eviction fills.

    Check yourself Why can two designs with identical LLC capacity have different private miss rates?

    An inclusive LLC causes inclusion victims through back-invalidation, and exclusive or NINE designs can still lose private lines to snoop filter evictions. LLC data capacity alone does not describe either.

    Related topics

    • Shared course model

    • Part 9 LLC model

    • LLC tag versus snoop filter

    • Controlled comparison

    Previous

    101 / 167

    Next: Devices and DMA

    Up next

    Up nextDevices and DMA

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Inclusive, Exclusive and Non-Inclusive
    • Back-Invalidation