Why architecture matters here
The architecture matters because cache hit rate is often the dominant factor in a system's performance, and the replacement policy is what determines the hit rate under a fixed cache size. A few percentage points of hit rate can be the difference between serving from fast memory and falling through to a disk or a database an order of magnitude slower. When you cannot simply buy more cache, a smarter eviction policy is free performance — and ARC's adaptivity extracts more hits than a fixed policy across a wide range of real workloads.
It matters because real workloads are not stationary, and a fixed policy tuned for one regime is wrong for the next. A database buffer pool sees index pages hammered repeatedly (frequency-friendly) interleaved with a big analytical scan (recency-hostile) and then a shift to a new hot set as the workload rotates. No single fixed LRU-or-LFU choice is right across all of that. ARC's whole reason to exist is that it re-tunes itself as the workload moves, so it is never badly mismatched for long.
It matters because scan resistance is a concrete, common need that plain LRU fails catastrophically. A single sequential read of a large table under LRU evicts every hot page to cache pages that will never be reused — cache pollution that can crater performance for minutes afterward. ARC resists this structurally: one-time pages land in T1 and, because they are never referenced again, they never get promoted to the protected frequency list T2, so a scan can churn through T1 without disturbing the frequently used pages held in T2. Scan resistance falls out of the recency/frequency split for free.
It matters because ARC achieves all this without operator tuning, which is a huge operational win. LFU variants and segmented caches often expose knobs — segment sizes, aging rates, promotion thresholds — that must be hand-tuned per workload and re-tuned when it changes, a never-ending chore that is usually done badly. ARC's p is tuned by the algorithm itself from the ghost-list feedback, so it is a genuinely self-tuning cache: you give it a size and it figures out the recency/frequency balance on its own.
Finally it matters because it does all this cheaply — constant time per operation and modest metadata. The four lists are maintained with O(1) work per request, and the ghost lists store only keys, not data, so the memory overhead beyond the cached data itself is small (roughly the keys of another cache's worth of entries). That efficiency is why ARC could ship in performance-critical storage stacks where a policy that was smart but slow, or smart but memory-hungry, would never have been acceptable. Adaptivity without a runtime cost is what made it practical.
The architecture: every piece explained
The core state is four lists over a cache of fixed size c. T1 holds pages that have been referenced exactly once recently — the recency list, where newly seen pages enter. T2 holds pages referenced at least twice — the frequency list, the protected set of things proven to be reused. Together T1 and T2 contain the actual cached data and their combined size is at most c. A page's location encodes its history: fresh arrivals sit in T1, and a second reference promotes a page from T1 to T2.
The distinctive pieces are the two ghost lists, B1 and B2. B1 holds the keys of pages recently evicted from T1; B2 holds the keys of pages recently evicted from T2. They store keys only — no page data — so they are cheap, and they exist purely to detect a specific event: a request for a page ARC recently threw away. A hit in a ghost list is a phantom hit: it is a cache miss for data (the page must still be fetched) but a hit for learning, because it tells ARC that a recent eviction was a mistake and, critically, which side of the cache made it.
The adaptive target p is the single number that captures everything ARC has learned. It is the target size for T1 — the amount of the cache ARC currently wants to devote to recency — with the remaining c minus p devoted to T2's frequency. p is not set by a human; it moves in response to phantom hits. A large p means 'this workload rewards keeping recently-seen-once pages'; a small p means 'this workload rewards keeping frequently-used pages.' The entire adaptivity of ARC is the motion of this one parameter.
The adaptation rule ties phantom hits to p. A phantom hit in B1 means ARC evicted a recency-side page that was wanted again, so recency was under-served: ARC increases p (grows T1's target), and the increase is scaled by the relative sizes of B1 and B2 so the adjustment is proportional to how strong the signal is. A phantom hit in B2 means a frequency-side page was evicted too soon, so ARC decreases p (grows T2's target). The rule is symmetric and self-correcting: each mistake pushes p toward the balance that would have avoided it.
The last piece is the replacement routine that actually evicts under the discipline of p. When a new page must be brought in and the cache is full, ARC consults p and the current size of T1: if T1 is larger than its target p, it evicts the least-recently-used page from T1 (moving its key to ghost list B1); otherwise it evicts from T2 (moving its key to B2). This is how the abstract target p becomes concrete eviction decisions — p continuously biases which list gives up a page, and the evicted key goes into the matching ghost list so a future phantom hit can grade the decision. The four lists, the target, and the replacement routine together form a closed feedback loop.
End-to-end flow
Walk a page through ARC. A key is requested. First ARC checks T1 and T2 — the real cache. If the page is in either, it is a true hit: ARC serves the data and moves the page to the most-recently-used position of T2, because any hit (whether the page was in T1 or already in T2) means it has now been seen at least twice and belongs on the frequency side. A page's promotion from T1 to T2 on its second reference is how ARC distinguishes one-time pages from genuinely reused ones.
Now suppose the requested key is not in T1 or T2 but is in ghost list B1. This is a phantom hit on the recency side: the page was recently in T1, got evicted, and is now wanted again — evidence that ARC's recency budget was too small. So ARC increases the target p (by an amount scaled to the B1/B2 size ratio), fetches the page from the backing store, and inserts it — now into T2, because a page requested again after eviction is behaving like a frequent page. The phantom hit both fetched the data and shifted the dial toward recency.
Symmetrically, suppose the key is in ghost list B2. This is a phantom hit on the frequency side: a page ARC had promoted to T2 and then evicted is wanted again, evidence that ARC's frequency budget was too small. ARC decreases p (again scaled by the list sizes), fetches the page, and reinserts it into T2. The dial shifts toward frequency. Notice the pleasing symmetry: B1 hits argue for recency and push p up, B2 hits argue for frequency and push p down, and the workload's own access pattern arbitrates by producing more of one kind of phantom hit than the other.
Finally suppose the key is in none of the four lists — a genuine cold miss. ARC must fetch the page and make room. If the total cached data is at capacity, it invokes the replacement routine: it evicts from T1 or T2 according to whether T1 currently exceeds its target p, moving the victim's key into the corresponding ghost list. The ghost lists themselves are bounded, so an old ghost key may be discarded to make room for the new one. Then the freshly fetched page enters T1 as a newly-seen-once page. If it is never referenced again — as with a scan — it will drift down T1 and be evicted without ever polluting T2.
Trace the scan case explicitly, because it shows the design paying off. A big sequential read requests thousands of never-before-seen pages. Each is a cold miss, each enters T1, and none is ever referenced a second time, so none is promoted to T2. The scan churns entirely within T1, evicting its own earlier pages, while the hot pages sitting in T2 are untouched. When the scan ends and the normal workload resumes, its hot pages are still cached in T2, ready to hit. Plain LRU would have evicted them all to hold the scan; ARC's recency/frequency split protected them without any special scan-detection logic — the structure alone delivers scan resistance.