Learning Resources
This module is populated from the local chunked books in library/raw/semester-05-os-networking/books. Use this page as a source map, not as an instruction to read everything.
Source Stack
| Book | Role | How to use it in this module |
|---|---|---|
| Operating Systems: Three Easy Pieces (Arpaci-Dusseau) | Primary teaching source | Default for all virtual memory mechanism and policy explanations. The "Three Easy Pieces" split puts virtualization (of which VM is half) at the center of the book |
| Operating System Concepts (Silberschatz) | Selective support for rigor | Use for formal replacement-policy definitions, a cleaner treatment of fragmentation, and additional examples like page-replacement algorithms |
| Computer Networking / Unix Network Programming | Not used this module | Reserved for later networking modules |
Resource Map by Cluster
Cluster 1: Address Spaces and Translation
| Need | Best local chunk | Why |
|---|---|---|
| why virtualize memory at all | OSTEP: Virtualizing memory | Cleanest "why" argument; sets up every downstream concept |
| dialogue intro | OSTEP: Dialogue on memory virtualization | Arpaci-Dusseau style framing of the whole problem |
| the address-space abstraction | OSTEP: The address space | Defines what a process "sees" as memory |
| every address you see is virtual | OSTEP: Aside - every address you see is virtual | The tiny but sticky insight |
| early systems (pre-VM) | OSTEP: Early systems | Motivates why base/bounds and paging arose |
| base/bounds + dynamic relocation | OSTEP: Dynamic relocation example | The minimal model of translation |
| software-based relocation | OSTEP: Aside - software-based relocation | The failed historical alternative |
| HW support summary | OSTEP: Hardware support summary | What the MMU must provide |
| segmentation generalized | OSTEP: Segmentation - generalized base/bounds | Segments are base/bounds per region |
| the segmentation fault | OSTEP: Aside - the segmentation fault | Where the term comes from and what it means today |
| segment sharing | OSTEP: Support for sharing | Why segments allowed sharing but paging finishes the job |
| segmentation OS support | OSTEP: Segmentation OS support | Allocator problem segments expose |
| paging intro | OSTEP: A simple example and overview | The clearest paging walkthrough in the book |
| paging is slow without TLB | OSTEP: Paging is also too slow | Motivates the TLB |
| page-table data structure | OSTEP: Aside - the page table | Data-structure view of PTEs |
Cluster 2: Page Tables and the TLB
| Need | Best local chunk | Why |
|---|---|---|
| page-table walk worked example | OSTEP: Paging walkthrough | Worked translation with numbers |
| page table sample PTE layout | OSTEP: 1124 pagetable | Shows PTE bits (present, dirty, etc.) |
| bigger-page shortcut | OSTEP: Simple solution - bigger pages | Why huge pages help, and their cost |
| hybrid paging + segments | OSTEP: Hybrid approach | Design alternative to multi-level |
| multi-level page tables | OSTEP: Multi-level page tables | The canonical tree-structured table |
| multi-level page tables cont. | OSTEP: Multi-level page tables (part 2) | Continuation with cost analysis |
| inverted page tables | OSTEP: Inverted page tables | Design alternative indexed by frame |
| TLB basic algorithm | OSTEP: TLB basic algorithm | The core translation-caching idea |
| TLB example | OSTEP: Example - accessing an array | Why locality makes TLBs work |
| TLB + context switches | OSTEP: TLB issue - context switches | Motivates ASID/PCID |
| real TLB entry | OSTEP: A real TLB entry | Actual hardware PTE format |
| hypervisor-managed TLBs | OSTEP: Aside - hypervisors and hardware-managed TLBs | Nested-paging wrinkle |
Cluster 3: Page Replacement and Swapping
| Need | Best local chunk | Why |
|---|---|---|
| beyond physical memory | OSTEP: Beyond physical memory mechanisms | Establishes why swapping exists |
| swap space | OSTEP: Swap space | Storage backing VM |
| the page fault | OSTEP: The page fault | Fault semantics |
| why HW does not handle faults | OSTEP: Aside - why HW does not handle page faults | Why the OS is on the hook |
| page-fault control flow | OSTEP: Page-fault control flow | The canonical algorithm |
| when replacement happens | OSTEP: When replacements really occur | High/low watermarks in practice |
| cache management framing | OSTEP: Cache management | VM as a cache |
| optimal policy | OSTEP: The optimal replacement policy | OPT as the theoretical lower bound |
| FIFO | OSTEP: FIFO | Simplest real policy and Belady's anomaly |
| workloads | OSTEP: Workload examples | How workload shape changes which policy wins |
| no-locality workload | OSTEP: The no-locality workload | Where every policy looks the same |
| implementation | OSTEP: Implementing historical algorithms | Why exact LRU is not implemented |
| thrashing context | OSTEP: 23.1 background | Sets up replacement policies in Linux |
| linux page replacement | OSTEP: Linux page replacement | Real kernel policy sketch |
| vm tricks | OSTEP: Other neat VM tricks | CoW, zero-page, CSM, etc. |
| OSC: basic page replacement | OSC: Basic page replacement | Alternate exposition of FIFO/LRU/OPT |
| OSC: LRU | OSC: LRU page replacement | Focused LRU treatment |
| OSC: LRU approximations | OSC: LRU approximation page replacement | Clock and reference-bit policies |
| demand paging performance | OSC: Performance of demand paging | Quantitative fault-cost models |
| global vs local replacement | OSC: Global versus local allocation | Working-set policy context |
| memory compression | OSC: Memory compression | zswap-style modern wrinkle |
Cluster 4: Allocators and Fragmentation
| Need | Best local chunk | Why |
|---|---|---|
| types of memory | OSTEP: Types of memory | Stack vs heap vs static |
| malloc API | OSTEP: The malloc call | malloc/free from user view |
| common allocator bugs | OSTEP: Common errors | Use-after-free, leaks, double-free |
| forgetting to free | OSTEP: Forgetting to free memory | The leak canonical example |
| OS support for heap | OSTEP: Underlying OS support | brk/mmap as heap backing |
| free-space management strategies | OSTEP: Basic strategies | First-fit, best-fit, worst-fit |
| other approaches | OSTEP: Other approaches (segregated lists) | Slab/segregated lists, buddy allocator |
| malloc library (appendix) | OSTEP: Memory allocation library | Writing your own malloc |
| OSC: fragmentation | OSC: Fragmentation | Clean definitions of internal/external |
| OSC: physical memory mgmt | OSC: Management of physical memory | Real kernel allocator description |
| OSC: user-level memory managers | OSC: User-level memory managers | Userland allocator landscape |
| OSC: memory management overview | OSC: Memory management (part four) | Unified memory management framing |
Cluster 5: Practical Virtual Memory Effects
| Need | Best local chunk | Why |
|---|---|---|
| fork system call | OSTEP: The fork system call | Essential to understand CoW |
| copy-on-write mappings | OSTEP: Copy-on-write mappings | The CoW mechanism in detail |
| VM tricks overview | OSTEP: Other neat VM tricks | CoW, zero-filled, shared libraries |
| memory virt summary dialogue | OSTEP: Summary dialogue on memory virtualization | Closes the VM story with perspective |
| bigger pages | OSTEP: Simple solution - bigger pages | Motivates huge pages |
| OSC: virtual memory chapter intro | OSC: Virtual memory | OS-level overview with Linux flavor |
External Resources (Read-If-Curious)
Only use these if you want a second exposition or supplementary problem source. The module is completable from the local chunks alone.
- Operating Systems: Three Easy Pieces (free online) - the book itself; the virtual memory chapters are the main source for this module.
- Linux kernel memory-management documentation - authoritative Linux memory-management admin guide (THP, NUMA,
numactl, cgroups v2 memory controller). - LWN: Transparent huge pages in 2.6.38 - the canonical historical explanation of THP in Linux.
- Brendan Gregg: Memory flame graphs - practical VM performance analysis with flame graphs.
- Brendan Gregg: Linux performance observability -
perf,vmstat,/proc/pressure/memory, and the modern Linux memory toolkit. - jemalloc documentation - reference for the leading production userland allocator.
- tcmalloc documentation - Google's allocator, paired with profiling tools.
Use Rules
- If you are stuck on a mechanism (how does translation / paging / the TLB work?), go to OSTEP first. It is operationally the best.
- If you want a second, more formal exposition or a different treatment of fragmentation and replacement, open Operating System Concepts.
- For Linux specifics (THP, NUMA,
numactl,/proc/meminfo,/proc/pressure/memory), use the externaldocs.kernel.organd LWN links. - For real allocator internals (jemalloc, tcmalloc), go to the official docs. Books lag here.
- Open one chunk for one concept gap; do not read sequential OSTEP chapters on autopilot.
- If rereading does not fix the problem, stop and run the relevant practice lab. In this module, the fix is almost always experimental, not more reading.