{
  "slug": "program-counter-based-classification",
  "term": "Program-counter-based classification (PCC)",
  "aliases": [
    "PCC buffer classification",
    "Program-Counter-based Classification"
  ],
  "definition": "PCC classifies buffer-cache accesses by the program contexts issuing I/O, allowing learned access patterns to guide replacement across files.",
  "note": "PCC's signature PC sums call-site addresses along the stack up to main(), separating callers that share an I/O wrapper. A single system-call address would merge those callers. The historical 32-bit signature is a compact context key, not a collision-free identity. [pcc]\n\nThe block table records the last accessing context. When a tracked block is reused, its previous context receives the reuse evidence, even if a different context issues the new access. The classifier's sequential category means distinct blocks without reuse, not necessarily adjacent disk addresses. [pcc]\n\nThe OSDI 2004 comparison replaced UBM's classifier while retaining its marginal-gain cache manager; the kernel implementation used Linux 2.4.20. AMP's later PCC* comparator instead used PCC detection with AMP cache management. These are different experimental comparisons. [pcc] [amp]\n\nFor synthetic address lists, [0x1000,0x2000,0x4000] and [0x1000,0x2800,0x3800] both sum to 0x7000. This collision needs neither overflow nor identical frames. Exact-list identity separates them; a sum alone does not. The downloadable calculation is an arithmetic illustration, not a measured collision rate or cache benchmark. [example]",
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "Sampling and context history affect classification; a learned pattern is a prediction, not a guarantee of future block reuse.",
      "citationIds": [
        "pcc"
      ]
    },
    {
      "text": "The Linux 2.4.20 prototype could not obtain signature PCs for mmap accesses and classified those references as other.",
      "citationIds": [
        "pcc"
      ]
    }
  ],
  "related": [
    "unified-buffer-management",
    "amp-buffer-caching",
    "locality-of-reference"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-21",
  "citations": [
    {
      "id": "pcc",
      "title": "Gniady, Butt and Hu. Program-Counter-Based Pattern Classification in Buffer Caching. OSDI 2004, sections 4-5.",
      "url": "https://www.usenix.org/legacy/publications/library/proceedings/osdi04/tech/full_papers/gnaidy/gnaidy_html/index.html",
      "accessed": "2026-11-21"
    },
    {
      "id": "amp",
      "title": "Zhou, von Behren and Brewer. AMP: Program Context Specific Buffer Caching. USENIX ATC 2005, sections 1-3.",
      "url": "https://www.usenix.org/legacy/event/usenix05/tech/general/full_papers/short_papers/zhou/zhou_html/index.html",
      "accessed": "2026-11-21"
    },
    {
      "id": "example",
      "title": "Hesela. Exact additive-signature examples: common wrappers, distinct sums and equal-sum collisions.",
      "url": "https://hesela.dev/research/pcc-context/examples.json",
      "accessed": "2026-11-21"
    },
    {
      "id": "code",
      "title": "Hesela. Bounded exact-sum illustration; no stack unwinding, cache simulation or hash-probability model.",
      "url": "https://hesela.dev/research/pcc-context/model.mjs",
      "accessed": "2026-11-21"
    },
    {
      "id": "tests",
      "title": "Hesela. Signature arithmetic tests and an independent bit-column addition oracle.",
      "url": "https://hesela.dev/research/pcc-context/model.test.mjs",
      "accessed": "2026-11-21"
    },
    {
      "id": "guide",
      "title": "Hesela. Interpretation, reproduction instructions and limits of the signature example.",
      "url": "https://hesela.dev/research/pcc-context/README.txt",
      "accessed": "2026-11-21"
    }
  ],
  "provenance": [
    "Full primary-paper design and evaluation reviewed. Historical workloads and kernel results are not performance predictions for current systems. [pcc] [amp]",
    "The constructed equal-sum case uses invented addresses, not executable traces. It establishes non-unique arithmetic, not observed collisions in PCC. [example]"
  ]
}
