Understanding the Linux Kernel 读书笔记-Block Device Drivers

We start in the first section “Block Devices Handling” to explain the general architecture of the Linux block I/O subsystem. In the sections “The Generic Block Layer,” “The I/O Scheduler,” and “Block Device Drivers,” we will describe the main components of the block I/O subsystem. Finally, in the last section, “Opening a Block Device File,” we will outline the steps performed by the kernel when opening a block device file.

Understanding the Linux Kernel 读书笔记-Process Address Space

A kernel function gets dynamic memory in a fairly straightforward manner by invoking one of a variety of functions: __get_free_pages() or alloc_pages() to get pages from the zoned page frame allocator, kmem_cache_ alloc() or kmalloc() to use the slab allocator for specialized or general-purpose objects, and vmalloc() or vmalloc_32() to get a noncontiguous memory area. If the request can be satisfied, each of these functions returns a page descriptor address or a linear address identifying the beginning of the allocated dynamic memory area.

Understanding the Linux Kernel 读书笔记-Memory Management

The sections “Page Frame Management” and “Memory Area Management” illustrate two different techniques for handling physically contiguous memory areas, while the section “Noncontiguous Memory Area Management” illustrates a third technique that handles noncontiguous memory areas. In these sections we’ll cover topics such as memory zones, kernel mappings, the buddy system, the slab cache, and memory pools.