Find an introduction to the architecture, concepts and algorithms of the Linux kernel in Professional Linux Kernel Architecture , a guide to the kernel sources and large number of connections among subsystems. Find an introduction to the relevant structures and functions exported by the kernel to userland, understand the theoretical and conceptual aspects of the Linux kernel and Unix derivatives, and gain a deeper understanding of the kernel. Learn how to reduce the vast amount of information contained in the kernel sources and obtain the skills necessary to understand the kernel sources.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Professional Linux Kernel Architecture — Reading Guide
## 【One-Line Pitch】
A deep, source-code-level tour of the Linux kernel's core subsystems—process management, scheduling, and memory management—for developers and students who want to move beyond black-box usage and truly understand how the kernel works. If you are comfortable with C and basic OS concepts but find the kernel sources overwhelming, this book gives you the map you need.
## 【Book Arc】
- **Opening (~0%–3%)**: Introduces the book's mission—teaching readers to navigate the kernel sources and understand subsystem interconnections—and previews the major topics, including page reclaim, swapping, and the buddy system's role in memory allocation.
- **Early (~3%–13%)**: Lays the groundwork for memory management with the buddy system and slab cache, then moves into process management, covering process states (running, waiting, sleeping, stopped, zombie), the rationale behind zombies, and how PID namespaces work.
- **Early (~13%–23%)**: Dives into the Completely Fair Scheduler (CFS), explaining the red-black tree run queue, the virtual clock concept, and how the kernel emulates virtual time to ensure fair CPU distribution among processes.
- **Early (~23%–32%)**: Continues scheduler internals with load tracking and `vruntime` updates, then introduces `cond_resched` as a mechanism for reducing latency in long kernel operations—a key technique when kernel preemption is disabled.
- **Middle (~32%–48%)**: Shifts to deep memory management: page table layout across architectures (PGD/PUD/PMD/PTE bit shifts), the x86 direct mapping and vmalloc area with guard pages, and the buddy system's zone/node fallback lists plus anti-fragmentation measures like page mobility grouping.
## 【Key Takeaways】
- **The buddy system is the foundation of physical memory allocation** (Opening): It splits and merges contiguous page blocks, but suffers from fragmentation over time—a problem the kernel addresses with additional mechanisms discussed later. Understanding this base layer is essential before tackling anything else in memory management.
- **The slab cache sits atop the buddy system for small kernel objects** (Opening): Since the kernel cannot use the standard library, it needs its own layer to divide pages into smaller pieces and cache frequently used objects—this is the slab cache's dual role.
- **Zombie processes are a natural consequence of Unix process lifecycle** (Early): A process becomes a zombie when it is terminated but its parent has not yet called `wait4`; the kernel keeps the process table entry until the parent acknowledges the death. This explains a common system-administration phenomenon.
- **PID namespaces require per-namespace PID allocation** (Early): When a process is created, the kernel walks from the creating namespace down to the global one, generating a local PID for each level and storing them in a hierarchical `struct pid`—critical for containers and virtualization.
- **CFS uses a red-black tree and virtual clock for fairness** (Early): The run queue is a red-black tree where tasks waiting less time are sorted left-to-right; a virtual clock runs slower with more processes, and the kernel emulates it by weighting execution time according to process load. This replaces the older O(1) scheduler's approach.
- **`cond_resched` provides voluntary preemption points** (Early): Long kernel operations (like reading memory pages in a loop) can call `cond_resched` to check if another process needs the CPU—reducing latency even when kernel preemption is compiled out, which matters for network servers.
- **Page tables are architecture-dependent but follow a common hierarchy** (Middle): The kernel uses macros like `PAGE_SHIFT`, `PMD_SHIFT`, and `PGDIR_SHIFT` to split virtual addresses into PGD/PUD/PMD/PTE components, allowing the same memory-management code to work across CPUs with different address sizes.
- **The vmalloc area is deliberately separated from direct mappings by a guard gap** (Middle): An 8 MiB `VMALLOC_OFFSET` ensures that out-of-bounds accesses fail loudly instead of silently hitting valid memory—a safety measure that aids kernel development and debugging.
## 【Reading Tips】
- **Skim the opening chapter's overview sections** (~0%–3%) if you already know basic OS concepts; they are mostly scene-setting. Focus instead on the concrete mechanisms (buddy system, slab cache) that reappear throughout.
- **Deep-read the CFS scheduler sections** (~13%–23%): The virtual clock explanation is the clearest way to understand fair scheduling, but note that the kernel's actual implementation emulates the clock—do not get stuck on the simplified model.
- **Pay attention to code snippets with file paths** (e.g., `kernel/sched_fair.c`, `mm/vmalloc.c`): These are your map to the real sources. The book's value is in teaching you to find and read these files yourself, not just memorizing the excerpts.
- **The memory-management chapters (~32%–48%) are dense**: Read them with a machine that can run Linux and inspect `/proc/buddyinfo` or test fragmentation behavior. The bit-shift macros for page tables are easier to grasp with a concrete architecture (x86) in mind.
- **Take away the "how to approach kernel sources" skill**: The book repeatedly shows one subsystem's connections to others (e.g., buddy system → zones → nodes → fallback lists). Note these cross-references; they are the real curriculum.
## 【Coverage Limits】
The excerpts cover process management, CFS scheduling, and memory management (buddy system, slab, page tables, vmalloc) in depth, but do not include later chapters on I/O, filesystems, networking, or device drivers. The guide reflects only the sampled material.
##
Excerpt 1
rtage 1090 Shrinking Other Caches 1092 Data Structures 1092 Registering and Removing Shrinkers 1093 Shrinking Caches 1093 Summary 1095 xxii Mauerer runc01.te...
basis of the Unix model of process creation. The following terminology is used in this context: ❑ If process A forks to generate process B, A is known as the...
: for (;;) /* Read in data */ if (exit_condition) continue; 34Additionally, the function also makes sure that the system is completely up and running, which...
rve[classzone_idx]) return 0; for (o = 0; o < order; o++) { /* At the next order, this order’s pages become unavailable */ free_pages -= z->free_area[o].nr_f...
In other words, the mapped data are not read in immediately when the mapping is created but only when they are actually needed. Chapter 8 takes a closer look...
but 363 Mauerer runc05.tex V3 - 09/04/2008 4:59pm Page 387 Chapter 5: Locking and Interprocess Communication information on the implementation structure, I w...
dule information to accept a list of different device types supported by the driver. Querying module information using the modinfo tool is not difficult, as...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Professional Linux kernel architecture (Wolfgang Mauerer)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Professional Linux kernel architecture (Wolfgang Mauerer)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment