The full picture
- Walk anatomy (x86-64): CR3 → PML4 → PDPT → PD → PT → frame; each level indexes 9 bits of the VPN. Hardware walks it on TLB miss; the walked result is cached (plus mid-level 'paging structure caches').
- Context switches flush translation state (mitigated by ASID/PCID tagging) — part of why switches cost more than the register copy suggests.
- Huge pages trade-offs: 2MB pages cut misses and walk depth, but risk internal fragmentation and (with transparent HP) latency spikes from khugepaged compaction — why some databases say THP=never while JVMs often benefit from explicit/THP-madvise setups. The nuanced answer is 'huge pages yes, transparent defrag carefully'.
- When you'd notice: perf counters
dTLB-load-misseshigh on a 100GB-heap service or a hash-join-heavy database — the fix (huge pages) can be worth 10–20% wall time. Also: iterating a 2D array column-major vs row-major is a TLB story as much as a cache story.