The address space
A pointer on x86-64 is a 64-bit value, but the address space it names is not a 64-bit space. Implementing
Page tables
Translation is a size problem before it's anything else. A flat table mapping every 4 KiB page of a
TLB and switching
Page Tables and the Walk established that a translation costs up to
mm_struct and VMAs
The Virtual Address Space described the layout a process's pointers
Page fault handler
The Life of a Page Fault told this story shallowly, as
Demand paging and COW
The Page Fault Handler named doanonymouspage() and dowppage() as
Page allocator
Every other allocator in the kernel — slab, vmalloc, the page cache, the stack allocator — ultimately
Slab and kmalloc
The Page Allocator deals in 4 KiB units. The kernel allocates `struct
Choosing an allocator
Every allocation decision in the kernel eventually comes down to one distinction: physically
Folios
struct page describes one 4 KiB frame of physical memory, and there is one struct page for every
Page cache
This is the single most consequential piece of Linux memory management, and the one most misread by
Writeback and fsync
There is a gap between "the write returned" and "the data is safe", and most data-loss incidents live
Reclaim
The Page Allocator hands out pages until it can't. A system that only
Swap
Swap has an undeserved reputation. It is not "what happens when a machine runs out of memory" — it is
OOM killer
By the time this code runs, every allocation path has already failed, reclaim has already been asked and
Huge pages
A TLB holds a fixed number of entries, and its reach — the amount of address space it can translate
NUMA policy
Node-local allocation by default, the policies that override it, and when NUMA effects are a red herring.
free and RSS
How to actually answer "how much memory is this using", and why every simple answer to that question is wrong.