[$] Facing down mapcount madness

Post Syndicated from corbet original https://lwn.net/Articles/974223/

The page
structure
is a complicated beast, but some parts of it are more
intimidating than others. The mapcount field is one of the
scarier parts. It allegedly records the number of references to the page
in page tables, but, as David Hildenbrand described during the
memory-management track at the 2024 Linux Storage,
Filesystem, Memory Management, and BPF Summit
, things are more
complicated than that. Few people truly understand the semantics of this
field, but the situation will hopefully get better over time.