Site Tools


wiki:cache-snoopy-protocols

Cache snoopy protocols

Snoopy protocols implement Cache coherence over a shared bus: every core's cache controller watches (“snoops”) every transaction that appears on the bus, regardless of whether it issued that transaction, and reacts if the address concerns a line it currently holds. There is no central coordinator; coherence emerges from every cache independently applying the same rules to the same broadcast traffic.

Why a shared bus works

A bus has a useful property that makes snooping possible in the first place: it is a totally ordered broadcast medium. Every core sees every transaction in the same order, because only one transaction can be on the bus at a time. That total order is what lets each cache controller apply purely local rules (its own state machine, driven by what it snoops) and still end up in a state consistent with every other cache, without any of them talking to each other directly.

The cost that limits scaling

Every write has to be broadcast to every cache, whether or not most of them hold the line in question. This is cheap with a handful of cores, but the bus's fixed bandwidth becomes the bottleneck as core count grows: doubling the cores roughly doubles the snoop traffic each core has to filter, even for cores with no interest in the address. This is the practical reason large many-socket systems move to directory-based coherence instead, trading broadcast simplicity for explicit sharer tracking that only messages the cores that actually need to know.

Protocol family

Snoopy protocols are usually described as state machines attached to each cache line, where the states track whether the line is exclusively owned, shared read-only, or dirty relative to memory. The specific protocols differ in which states they support and how they handle write propagation:

  • WTI — write-through invalidate, the simplest and earliest approach
  • MSI — Modified/Shared/Invalid, the baseline write-back protocol
  • MESI — adds an Exclusive state to avoid a bus transaction on the common case of writing to a line only one core holds
  • MOESI — adds an Owned state so a dirty line can be shared directly from cache to cache without writing back to memory first
  • Dragon — an update-based (rather than invalidate-based) protocol
  • Firefly — another update-based protocol, contemporary with Dragon
wiki/cache-snoopy-protocols.md · Last modified: by 127.0.0.1