Next:
Contents
 
Contents
 
Index
Understanding The
Linux Virtual Memory Manager
Mel Gorman
[2]
March 18, 2003
Contents
Abstract
1. Introduction
1.1 Thesis Overview
1.2 Typographic Conventions
2. Code Management
2.1 Managing the Source
2.1.1 Diff and Patch
2.1.2 Browsing the Code
2.1.3 Analyzing Code Flow
2.1.4 Basic Source Management with patchset
2.2 Getting Started
2.3 Submitting Work
3. Describing Physical Memory
3.1 Nodes
3.2 Zones
3.2.1 Zone Watermarks
3.3 Pages
3.3.1 Mapping Pages to Zones
4. Page Table Management
4.1 Describing the Page Directory
4.2 Describing a Page Table Entry
4.3 Using Page Table Entries
4.4 Translating and Setting Page Table Entries
4.5 Allocating and Freeing Page Tables
4.6 Initialising Kernel Page Tables
4.6.1 Bootstrapping
4.6.2 Finalizing
5. Boot Memory Allocator
5.1 Representing the Boot Map
5.2 Initialising the Boot Memory Allocator
5.2.1 Calculating The Size of Zones
5.2.2 Initialising
bootmem_data
5.3 Allocating Memory
5.4 Freeing Memory
5.5 Retiring the Boot Memory Allocator
6. Physical Page Allocation
6.1 Managing Free Blocks
6.2 Allocating Pages
6.3 Free Pages
6.4 GFP Flags
6.4.1 Process Flags
6.5 Avoiding Fragmentation
7. Non-Contiguous Memory Allocation
7.1 Describing Virtual Memory Areas
7.2 Allocating A Non-Contiguous Area
7.3 Freeing A Non-Contiguous Area
8. Slab Allocator
8.1 Caches
8.1.1 Cache Descriptor
8.1.2 Cache Static Flags
8.1.3 Cache Dynamic Flags
8.1.4 Cache Allocation Flags
8.1.5 Cache Colouring
8.1.6 Cache Creation
8.1.7 Cache Reaping
8.1.8 Cache Shrinking
8.1.9 Cache Destroying
8.2 Slabs
8.2.1 Storing the Slab Descriptor
8.2.2 Slab Creation
8.2.3 Tracking Free Objects
8.2.4 Initialising the kmem_bufctl_t Array
8.2.5 Finding the Next Free Object
8.2.6 Updating kmem_bufctl_t
8.2.7 Calculating the Number of Objects on a Slab
8.2.8 Slab Destroying
8.3 Objects
8.3.1 Initialising Objects in a Slab
8.3.2 Object Allocation
8.3.3 Object Freeing
8.4 Sizes Cache
8.4.1 kmalloc
8.4.2 kfree
8.5 Per-CPU Object Cache
8.5.1 Describing the Per-CPU Object Cache
8.5.2 Adding/Removing Objects from the Per-CPU Cache
8.5.3 Enabling Per-CPU Caches
8.5.4 Updating Per-CPU Information
8.5.5 Draining a Per-CPU Cache
8.6 Slab Allocator Initialisation
8.7 Interfacing with the Buddy Allocator
9. Process Address Space
9.1 Linear Address Space
9.2 Managing the Address Space
9.3 Process Address Space Descriptor
9.3.1 Allocating a Descriptor
9.3.2 Initialising a Descriptor
9.3.3 Destroying a Descriptor
9.4 Memory Regions
9.4.1 File/Device backed memory regions
9.4.2 Creating A Memory Region
9.4.3 Finding a Mapped Memory Region
9.4.4 Finding a Free Memory Region
9.4.5 Inserting a memory region
9.4.6 Merging contiguous regions
9.4.7 Remapping and moving a memory region
9.4.8 Locking a Memory Region
9.4.9 Unlocking the region
9.4.10 Fixing up regions after locking
9.4.11 Deleting a memory region
9.4.12 Deleting all memory regions
9.5 Exception Handling
9.6 Page Faulting
9.6.1 Handling a Page Fault
9.6.2 Demand Allocation
9.6.3 Demand Paging
9.6.4 Copy On Write (COW) Pages
9.7 Copying To/From Userspace
10. High Memory Management
10.1 Managing the PKMap Address Space
10.2 Mapping High Memory Pages
10.2.1 Unmapping Pages
10.3 Mapping High Memory Pages Atomically
10.4 Bounce Buffers
10.4.1 Disk Buffering
10.4.2 Creating Bounce Buffers
10.4.3 Copying via bounce buffers
10.5 Emergency Pools
11. Page Frame Reclamation
11.1 Pageout Daemon (kswapd)
11.1.1 Page Replacement Policy
11.2 Page Cache
11.2.1 Adding Pages to the Page Cache
11.2.2 Page Cache Hash Table
11.3 Inode Queue
11.4 Shrinking all caches
11.5 Refilling inactive_list
11.6 Reclaiming pages from the page cache
11.7 Swapping Out Process Pages
12. Swap Management
12.1 Describing the Swap Area
12.2 Mapping Page Table Entries to Swap Entries
12.3 Allocating a swap slot
12.4 Swap Cache
12.5 Activating a Swap Area
12.6 Deactivating a Swap Area
12.7 Swapping In Pages
12.8 Swapping Out Pages
12.9 Read/Writing the Swap Area
13. Out Of Memory Management
13.1 Selecting a Process
13.2 Killing the Selected Process
Bibliography
Index
About this document ...
Mel Gorman 2003-03-18