
The Backend Engineering Show with Hussein Nasser CPU and Kernel Page Faults
21 snips
Nov 24, 2025 Dive into the fascinating world of page faults! Discover how processes access memory, the costs involved, and the mechanics of virtual memory. Learn about different types of faults including first-access, stack expansion, and copy-on-write. Explore the implications of memory sharing in multi-process environments and the performance overheads of kernel operations. Get insights into lazy loading and how the kernel manages memory mapping, alongside protecting processes with permissions. It's a deep yet engaging look at how our systems handle memory!
AI Snips
Chapters
Transcript
Episode notes
Virtual Memory As A Strategic Abstraction
- Virtual memory is an abstraction that maps large per-process virtual address spaces to physical pages on demand.
- This enables sharing, isolation, and running more processes than physical RAM allows via lazy loading and swap.
Page Tables And The MMU Do The Heavy Lifting
- Page tables translate virtual addresses to physical addresses and are written to by the kernel.
- The CPU's MMU performs page walks and checks a 'present' bit to decide if the kernel must intervene.
Virtual Memory Areas Shape Process Layout
- Processes' address spaces are divided into VMAs (text, data, BSS, heap, stack, mmap) with distinct permissions.
- VMAs are kernel data structures that can expand, split, and require locking, which adds complexity and contention.
