First-in first-out cache replacement
First-in first-out cache replacement evicts the resident entry that was inserted earliest, without refreshing its queue position on a hit.
This policy concerns eviction, not scheduling or write durability. A larger FIFO cache can have more misses on the same reference string. The unbounded anomaly result varies capacities and reference strings; it is not an unbounded ratio at fixed capacities. [1]
A ring buffer can avoid per-object pointers. Plain FIFO needs no queue-order update on a hit, but lookup, lifetime and synchronization work remain. Locked hit promotion is a shared-list implementation, not a requirement of every LRU implementation. [3] [4]
Lazy promotion defers movement until eviction; quick demotion removes unpromising new objects early. These variants are not plain FIFO. [4]
S3-FIFO uses small, main and ghost queues. Its paper policy caps frequency at three. Small-queue promotion uses frequency > 1, requiring two cache hits after insertion; movement clears the counter. Main-queue reinsertion uses frequency > 0 and decrements it. A single hit qualifies for main reinsertion but not small-queue promotion. [3]
Ghost history is not cached payload. A match remains a cache miss; fetched data goes directly to the main queue. A main-queue eviction does not add its victim to G. [3]
For N main-queue entries with counters at most three and no concurrent hits, insertions, expiration or resizing, an eviction takes at most 3N + 1 candidate inspections. Each reinsertion spends one counter credit; the final inspection removes a zero-counter entry. This is policy work, not elapsed time. [8] [9]
Flash friendliness does not guarantee zero amplification. Here cache-level rewriting, device-level garbage collection and admission filtering are separate; queue order alone does not establish NAND write volume. [5]
Relations
- related
- Belady anomaly, Cache inclusion property, Least recently used replacement, CLOCK cache replacement, SIEVE cache eviction, S3-FIFO, Flashield, First-come-first-served scheduling
Advantages
- No hit-time queue reordering is required by plain FIFO; this is a narrower benefit than eliminating all flash rewriting. [4, 5]
- The SOSP 2023 CacheLib prototype reported over six times the optimized LRU throughput at 16 threads on a synthetic Zipf workload (alpha = 1.0), not a universal FIFO speedup. Its request count and object population scale with thread count; the curve is not a fixed-working-set speedup. [3]
Limitations
- When most objects are requested exactly twice and the second request comes after the object leaves a small probationary queue, a partitioned FIFO design misses where plain FIFO or LRU could hit. [3]
- The paper's request-miss-ratio simulations usually ignore object sizes and exclude policy metadata from capacity; byte-miss evaluation uses byte-weighted footprint instead. Equal nominal capacity here is not an equal total-memory-budget comparison. [3]
Citations
- Peter Fornai and Antal Ivanyi. FIFO anomaly is unbounded. Acta Univ. Sapientiae, Informatica 2(1), 2010, pp. 80-89; sections 2-5, arXiv:1003.1336v2.
- Yang, Zhang, Qiu, Yue and Rashmi. FIFO Queues are All You Need for Cache Eviction. SOSP 2023
- Yang, Qiu, Zhang, Yue and Rashmi. FIFO can be Better than LRU: the Power of Lazy Promotion and Quick Demotion. HotOS 2023
- Eisenman et al. Flashield: a Hybrid Key-value Cache that Controls Flash Write Amplification. NSDI 2019, pp. 65-78; sections 2.1-2.2.
- SOSP 2023 author artifact, S3FIFO.c: default threshold, find and main-eviction paths; pinned commit 6bc49d9630572721b41cd08adfa982775f3cb1de.
- SOSP 2023 author artifact, cacheObj.h: S3FIFO_obj_metadata_t at the same pinned commit.
- Hesela: isolated S3-FIFO transition examples, assumptions and executable code; constructed, not a device or trace benchmark.
- Hesela: S3-FIFO transition method, finite-work proof and reproduction instructions.
Further reading
Sources & caveats
- Fornai and Ivanyi (2010), sections 4-5, Main Theorem and fixed-capacity qualification, rechecked 2026-10-25; the unboundedness quantifier ranges over capacities and reference strings.
- SOSP 2023 DOI 10.1145/3600006.3613147, sections 4, 5.1, 5.3 and 5.4, reviewed 2026-10-25. Miss-ratio traces, synthetic throughput and flash-admission experiments are separate evaluations.
- HotOS 2023 DOI 10.1145/3593856.3595887, sections 2-3 and Figure 2, reviewed 2026-10-25. Its flash-friendly motivation is not treated as a device-wide zero-amplification theorem.
- Flashield sections 2.1-2.2 supply the cache/device write-layer distinction. Source synthesis only: no new throughput or NAND measurement and no reproduction of the papers' benchmarks.
- SOSP 2023 section 5.3 specifies one million 4 KB objects and 100 million requests per thread; the scaling qualification was checked against that workload definition on 2026-10-25.
- SOSP 2023 section 5.4 and Figure 9 reread on 2026-10-26: flash size is relative to unique trace bytes; DRAM fractions are relative to flash capacity. These are distinct from section 4's small/main resident partition.
- Rechecked 2026-11-05: section 4.1 explicitly clears access bits on small-to-main movement; that reset is not shown in Algorithm 1's promotion branch. The isolated example follows the prose, not a literal execution of every pseudocode line. [3]
- The HotOS study tested 5307 traces; not every trace favored FIFO-Reinsertion over LRU, and results varied with capacity and workload. [4]
- S3-FIFO's evaluated default gives 10% of resident space to the small queue, 90% to main, and ghost metadata for as many entries as main. Its miss-ratio evaluation uses 6594 traces from 14 datasets. [3]
- The flash-admission comparison uses 10% of the trace footprint in bytes for flash, with DRAM at 0.1%, 1% or 10% of flash capacity. These are tier-capacity denominators, not the resident queue split. [3]
- The pinned author simulator increments a 64-bit frequency field on hits and clips it during main-queue reinsertion. Two policy bits are not a measurement of total metadata. Source inspection, not execution of that simulator. [6] [7]
- SOSP 2023 section 4.1/Algorithm 1, pp. 134-135, and section 5.1, pp. 136-137, reread 2026-10-31. Pinned find/insert/eviction paths corroborate routing. The example is not an admission simulator. [3] [6]