{
  "slug": "ghost-cache-entry",
  "term": "Ghost cache entry",
  "aliases": [
    "cache history entry"
  ],
  "definition": "In history-based cache policies, a ghost entry records a nonresident item's identity or history without retaining its cached payload.",
  "note": "An ARC history hit is still a cache miss requiring a fetch. [arc]\n\nIn FAST 2003 ARC, the cache and ghosts remember at most twice the cache capacity in page identities. If T1 holds c pages, a new-page miss discards its oldest entry without adding it to a ghost list. An initially empty cache receiving only distinct requests can fill T1 while both ghost lists stay empty. [arc]\n\nA history hit fetches the page into T2 and adjusts recency target p within [0, c]. With B1 containing 2 entries and B2 containing 6, a B1 hit requests an increase of 3 before the capacity cap. For c = 10, p moves from 9 to 10, not to 12. [arc] [arc-example]\n\n2Q keeps an out-queue of identifiers evicted from its first-access queue and promotes a page found there to the main queue. [twoq] The MQ experiments used FIFO history for four times the resident block count; a reload uses the remembered count plus one. [mq] LIRS tracks nonresident blocks in its stack and promotes a re-accessed one to low-reuse-distance status. [lirs]\n\nLinux can keep history in its page-cache index. Eviction leaves a counter snapshot as a shadow entry. On refault the counter difference gives a distance used to decide immediate activation. The v6.12 comment estimates shadow-node reclaim near 1.8% of available memory on 64-bit with seven nodes per page and 64 slots per node, not a hard memory cap. [ws]\n\nLRU-K keeps reference history separately from cached pages. Putting updated timestamps in a page header would force otherwise clean pages to be written back on eviction. Discarding history with the payload can instead make recurring pages look new. Its retained-information period bounds history lifetime, not payload residence. [lruk]\n\nLARC history can describe blocks that never entered the payload cache. [larc]",
  "status": "research",
  "advantages": [
    {
      "text": "A small history separates re-requested items from first-time ones, so one-time scans can be filtered out while reused items are promoted.",
      "citationIds": [
        "twoq",
        "arc"
      ]
    }
  ],
  "limitations": [
    {
      "text": "For four history entries per 8 KiB block, entries of h bytes use 4h/8192 of resident payload. With h < 32 this is below 1.5625%, not a measured overhead or a bound on total implementation memory.",
      "citationIds": [
        "mq"
      ]
    },
    {
      "text": "History without a bound, as in LIRS according to the ARC authors, can have unbounded space overhead.",
      "citationIds": [
        "arc",
        "lirs"
      ]
    },
    {
      "text": "Flashield uses ghost for a different state: current data can remain readable before segment reclamation.",
      "citationIds": [
        "flashield"
      ]
    }
  ],
  "related": [
    "adaptive-replacement-cache",
    "cache-pollution",
    "mapping-cache",
    "lru-replacement",
    "fifo-replacement",
    "clock-replacement",
    "clock-pro",
    "two-queue-replacement",
    "multi-queue-replacement",
    "linux-refault-distance",
    "flashield",
    "lecar",
    "cacheus",
    "mimir",
    "cliffhanger",
    "gl-cache",
    "lazy-adaptive-replacement-cache"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-29",
  "citations": [
    {
      "id": "arc",
      "title": "Megiddo and Modha. ARC: A Self-Tuning, Low Overhead Replacement Cache. FAST 2003, section III(A); Figure 4, cases II and IV(A).",
      "url": "https://www.usenix.org/event/fast03/tech/full_papers/megiddo/megiddo.pdf",
      "accessed": "2026-11-02"
    },
    {
      "id": "hesela",
      "title": "Hesela: mapping caches, scan phases and cache-history semantics (constructed examples)",
      "url": "https://hesela.com/analyses/ssd-mapping-cache-hmb/#scan-pollution",
      "accessed": "2026-10-15"
    },
    {
      "id": "twoq",
      "title": "Johnson and Shasha. 2Q: A Low Overhead High Performance Buffer Management Replacement Algorithm. VLDB 1994, pp. 439-450.",
      "url": "https://www.vldb.org/conf/1994/P439.PDF",
      "accessed": "2026-10-16"
    },
    {
      "id": "mq",
      "title": "Zhou, Philbin and Li. The Multi-Queue Replacement Algorithm for Second Level Buffer Caches. USENIX ATC 2001.",
      "url": "https://www.usenix.org/legacy/events/usenix01/full_papers/zhou/zhou.pdf",
      "accessed": "2026-10-31"
    },
    {
      "id": "lirs",
      "title": "Jiang and Zhang. LIRS: An Efficient Low Inter-reference Recency Set Replacement Policy to Improve Buffer Cache Performance. SIGMETRICS 2002.",
      "url": "https://xiaodongzhang1911.github.io/Zhang-papers/TR-02-6.pdf",
      "accessed": "2026-10-16"
    },
    {
      "id": "ws",
      "title": "Linux v6.12 mm/workingset.c, leading comment on double CLOCK lists and shadow entries.",
      "url": "https://github.com/torvalds/linux/blob/v6.12/mm/workingset.c",
      "accessed": "2026-11-07"
    },
    {
      "id": "lruk",
      "title": "O'Neil, O'Neil and Weikum. The LRU-K Page Replacement Algorithm for Database Disk Buffering. SIGMOD 1993, section 2.1.2, p. 301.",
      "url": "https://www.cs.cmu.edu/~christos/courses/721-resources/p297-o_neil.pdf",
      "accessed": "2026-11-02"
    },
    {
      "id": "arc-example",
      "title": "Hesela. ARC directory occupancy and bounded target updates: worked arithmetic and code.",
      "url": "https://hesela.dev/research/arc-directory.json",
      "accessed": "2026-11-02"
    },
    {
      "id": "flashield",
      "title": "Eisenman et al. Flashield. NSDI 2019, section 4.3.",
      "url": "https://www.usenix.org/system/files/nsdi19-eisenman.pdf",
      "accessed": "2026-11-10"
    },
    {
      "id": "larc",
      "title": "Huang, Wei, Chen, Chen and Feng. Improving Flash-based Disk Cache with Lazy Adaptive Replacement. MSST 2013, sections III and V.B; Algorithm 1.",
      "url": "https://msstconference.org/MSST-history/2013/Papers/2013.Paper.28.pdf",
      "accessed": "2026-11-29"
    }
  ],
  "provenance": [
    "The ARC paper has an author at an industrial research laboratory, the multi-queue paper is by an industrial research institute and a university, the 2Q paper has one author also at a software company, and LIRS is university work read from technical report TR-02-6.",
    "The MQ paper reports history overhead below 0.5%. At four entries per 8 KiB block this requires average entries below 10.24 bytes. The stated h < 32 bound alone does not establish it; the bounds are not a contradiction.",
    "The kernel behaviour is from the v6.12 source comments; 8 / (7 x 64) = 1.79% matches the comment figure of 1.8%.",
    "Arithmetic from the ARC rule: 6 / 2 = 3; a 1,000-page cache has a directory of at most 2,000 identifiers.",
    "The sources cover general buffer caches and a page cache, not SSD mapping caches; their trace results are not repeated.",
    "The 2c bound counts directory identities, not payload bytes or implementation metadata bytes. The cold-scan arithmetic follows Figure 4 under its stated assumptions; it is not a full ARC implementation."
  ]
}
