Finally, a comprehensive guide to the Linux VM!
VM's behavior affects every Linux kernel subsystem and dramatically impacts overall performance. But until now, there was only one way to understand VM: study the poorly documented source one line at a time. Now there's an easier, faster alternative. This book describes VM in unprecedented detail, presenting both theoretical foundations and a line-by-line source code commentary. It systematically covers everything from physical memory description to out-of-memory management. Coverage includes:
Well organized and superbly written, Understanding the Linux Virtual Memory Manager will be indispensable to every kernel programmer and researcher.
Complete VM Learning Lab! Contains the author's new toolkit for exploring VM, including a browsable version of kernel source, CodeViz call graph generator; and VMRegress for analyzing and benchmarking VM. Also includes all code commentary in HTML, PDF, and plain text formats.
Download the Sample
Chapter related to this title.
Getting Started. Managing the Source. Browsing the Code. Reading the Code. Submitting Patches.
Nodes. Zones. Zone Initialization. Initializing mem map. Pages. Mapping Pages to Zones. High Memory. Whats New in 2.6.
Describing the Page Directory. Describing a Page Table Entry. Using Page Table Entries. Translating and Setting Page Table Entries. Allocating and Freeing Page Tables. Kernel Page Tables. Mapping Addresses to a struct page. Translation Lookaside Bu.er (TLB). Level 1 CPU Cache Management. Whats New in 2.6.
Linear Address Space. Managing the Address Space. Process Address Space Descriptor. Memory Regions. Exception Handling. Page Faulting. Copying to/from Userspace. Whats New in 2.6.
Representing the Boot Map. Initializing the Boot Memory Allocator. Initializing bootmem data. Allocating Memory. Freeing Memory. Retiring the Boot Memory Allocator. Whats New in 2.6.
Managing Free Blocks. Allocating Pages. Free Pages. Get Free Page (GFP) Flags. Process Flags. Avoiding Fragmentation. Whats New in 2.6.
Describing Virtual Memory Areas. Allocating a Noncontiguous Area. Freeing a Noncontiguous Area. Whats New in 2.6.
Caches. Slabs. Objects. Sizes Cache. Per-CPU Object Cache. Slab Allocator Initialization. Interfacing With the Buddy Allocator. Whats New in 2.6.
Managing the PKMap Address Space. Mapping High Memory Pages. Unmapping Pages. Mapping High Memory Pages Atomically. Bounce Bu.ers. Emergency Pools. Whats New in 2.6.
Page Replacement Policy. Page Cache. LRU Lists. Shrinking All Caches. Swapping Out Process Pages. Pageout Daemon (kswapd). Whats New in 2.6.
Describing the Swap Area. Mapping Page Table Entries to Swap Entries. Allocating a Swap Slot. Swap Cache. Reading Pages From Backing Storage. Writing Pages to Backing Storage. Reading/Writing Swap Area Blocks. Activating a Swap Area. Deactivating a Swap Area. Whats New in 2.6.
Initializing the Virtual Filesystem. Using shmem Functions. Creating Files in tmpfs. Page Faulting Within a Virtual File. File Operations in tmpfs. Inode Operations in tmpfs. Setting Up Shared Regions. System V IPC. Whats New in 2.6.
Checking Available Memory. Determining OOM Status. Selecting a Process. Killing the Selected Process. Is That It? Whats New in 2.6.
Initializing Zones. Page Operations.
Page Table Initialization. Page Table Walking.
Process Memory Descriptors. Creating Memory Regions. Searching Memory Regions. Locking and Unlocking Memory Regions. Page Faulting. Page-Related Disk I/O.
Initializing the Boot Memory Allocator. Allocating Memory. Freeing Memory. Retiring the Boot Memory Allocator.
Allocating Pages. Allocation Helper Functions. Free Pages. Free Helper Functions.
Allocating a Noncontiguous Area. Freeing a Noncontiguous Area.
Cache Manipulation. Slabs. Objects. Sizes Cache. Per-CPU Object Cache. Slab Allocator Initialization. Interfacing with the Buddy Allocator.
Mapping High Memory Pages. Mapping High Memory Pages Atomically. Unmapping Pages. Unmapping High Memory Pages Atomically. Bounce Bu.ers. Emergency Pools.
Page Cache Operations. LRU List Operations. Re.lling inactive list. Reclaiming Pages From the LRU Lists. Shrinking All Caches. Swapping Out Process Pages. Page Swap Daemon.
Scanning for Free Entries. Swap Cache. Swap Area I/O. Activating a Swap Area. Deactivating a Swap Area.
Initializing shmfs. Creating Files in tmpfs. File Operations in tmpfs. Inode Operations in tmpfs. Page Faulting Within a Virtual File. Swap Space Interaction. Setting Up Shared Regions. System V IPC.
Determining Available Memory. Detecting and Recovering From OOM.