Page cache (source code)

= Page cache

Caching <file> contents in units based on <memory pages>, commonly by a <file> mapping and an offset, rather than necessarily by the device-and-block <buffer cache key> used above. A <file>'s offset must be mapped to storage before device access; the two naming systems describe different layers. How <page cache> and <buffer cache> storage relate depends on the <operating system> and <file system>. A separate duplicate copy at each layer is not a universal requirement.

For the <Linux kernel> interfaces documented in <Buffer Heads by The kernel development community>, per-block state can be attached to larger cached memory units called <Linux folios>; `mark_buffer_dirty` also marks the backing page dirty in the <page cache>. The documented reclamation checks include dirty state, pending <buffer cache writeback> and elevated reference counts. That documentation deprecates <Linux buffer heads> for new <file systems> in favour of <iomap>. These are platform-specific interfaces, not a definition that every <page cache> has <Linux buffer heads> or that every <buffer cache> has its own disjoint allocation. <Buffer Heads by The kernel development community>{ref}