{
  "slug": "multi-queue-replacement",
  "term": "Multi-Queue cache replacement",
  "aliases": [
    "MQ cache replacement",
    "MQ replacement algorithm"
  ],
  "definition": "Multi-Queue cache replacement combines frequency-ranked LRU queues, access-driven demotion and a bounded history of evicted blocks.",
  "note": "MQ addresses a lower-level buffer cache whose requests have been filtered by upper caches. Its original evaluation used four historical traces with 8 KiB blocks; this is a different request population from the application stream. [mq-traces]\n\nResident blocks occupy LRU queues ranked by access frequency. Replacement selects the head of the lowest nonempty queue. Evicted identifiers and counts enter FIFO history Qout; a history hit still fetches data and uses the remembered count plus one. [mq-algorithm]\n\nAging uses logical time measured in cache accesses, not elapsed seconds. An expired head above Q0 moves down one level and receives a new deadline. This is queue-priority aging, not a wall-clock data-validity TTL. Figure 5 changes position and deadline without decreasing the stored reference count; a later hit increments that count and recomputes placement. [mq-algorithm]\n\nThe reported experiments used eight resident queues and history capacity four times the resident block count. These are configuration choices, not the definition of MQ. [mq-settings] Linux blk-mq instead dispatches block I/O requests; it is not this cache policy. [linux-blk-mq]\n\nEach access checks at most m-1 queue heads for demotion, where m is the resident queue count. The paper calls this constant-time with a fixed, small queue count; allowing m to grow changes that work bound. [mq-algorithm]\n\nWith one queue, MQ reduces to LRU. With two queues, it is not 2Q: MQ uses two LRU queues and age-based demotion, while 2Q uses FIFO admission and does not put main-queue evictions into its history. Queue count alone therefore does not identify a replacement policy. [mq-algorithm]",
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "The historical storage-server results do not establish modern SSD mapping-cache performance or a universal advantage over LRU.",
      "citationIds": [
        "mq-system"
      ]
    },
    {
      "text": "The simulations adapt lifeTime from access-history statistics; the paper delegates the adjustment method to the author's thesis, so fixed-lifeTime demonstrations alone do not reproduce that evaluation.",
      "citationIds": [
        "mq-settings"
      ]
    },
    {
      "text": "MQ+Hints (2005) requires client tags: SYNCH marks imminent eviction, REPLACE preparation for eviction, and RECOV recovery-driven cleaning. SYNCH describes eviction timing, not durability. At a full cache, READ hits are served without queue updates and RECOV leaves replacement state unchanged; cold-start handling differs. These hints do not cancel storage writes.",
      "citationIds": [
        "mq-write-hints"
      ]
    }
  ],
  "related": [
    "ghost-cache-entry",
    "request-hit-ratio",
    "lru-replacement"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-02",
  "citations": [
    {
      "id": "mq-algorithm",
      "title": "Zhou, Philbin and Li. Multi-Queue Replacement Algorithm for Second Level Buffer Caches. USENIX ATC 2001, section 4 and Figure 5.",
      "url": "https://www.usenix.org/legacy/events/usenix01/full_papers/zhou/zhou_html/node9.html",
      "accessed": "2026-11-02"
    },
    {
      "id": "mq-traces",
      "title": "Zhou, Philbin and Li. Multi-Queue Replacement Algorithm. USENIX ATC 2001, section 2.2: traces and cache boundaries.",
      "url": "https://www.usenix.org/legacy/events/usenix01/full_papers/zhou/zhou_html/node4.html",
      "accessed": "2026-10-31"
    },
    {
      "id": "mq-settings",
      "title": "Zhou, Philbin and Li. Multi-Queue Replacement Algorithm. USENIX ATC 2001, section 5.1: simulation configuration.",
      "url": "https://www.usenix.org/legacy/events/usenix01/full_papers/zhou/zhou_html/node11.html",
      "accessed": "2026-10-31"
    },
    {
      "id": "mq-system",
      "title": "Zhou, Philbin and Li. Multi-Queue Replacement Algorithm. USENIX ATC 2001, section 6.1: storage-server architecture.",
      "url": "https://www.usenix.org/legacy/events/usenix01/full_papers/zhou/zhou_html/node15.html",
      "accessed": "2026-10-31"
    },
    {
      "id": "linux-blk-mq",
      "title": "Linux 6.16 documentation. Multi-Queue Block IO Queueing Mechanism: software staging and hardware dispatch.",
      "url": "https://docs.kernel.org/6.16/block/blk-mq.html",
      "accessed": "2026-10-31"
    },
    {
      "id": "mq-write-hints",
      "title": "Li, Aboulnaga, Salem, Sachedina and Gao. Second-Tier Cache Management Using Write Hints. FAST 2005, sections 3, 4.1, 4.3 and 5.1.",
      "url": "https://www.usenix.org/legacy/event/fast05/tech/full_papers/li_x/li_x_html/paper.html",
      "accessed": "2026-10-31"
    }
  ],
  "provenance": [
    "Source review of the original 2001 paper by Yuanyuan Zhou, James F. Philbin and Kai Li; no trace replay or hardware measurement.",
    "The storage-server implementation used Oracle 8i with TPC-C, a 128 MB upper cache and write-through storage caching.",
    "The 2005 hint-aware variant was evaluated by simulation of instrumented DB2 8.2/TPC-C traces, measuring second-tier read hit ratios after cache fill, with history space charged against the memory budget."
  ]
}
