Kernel Memory Allocation for Module Authors – Part 2
The previous chapter covered the basics (and a lot more!) of using the available APIs for memory allocation via both the page allocator (PA) or Buddy System Allocator (BSA) and the slab allocators within the kernel. In this chapter, we will delve further into this large and interesting topic. We will cover the creation of custom slab caches, the vmalloc
interfaces, and, very importantly, given the wealth of choice, which APIs to use in which situation. We shall then delve into some key kernel internal details regarding memory reclamation, the dreaded Out of Memory (OOM) killer, and demand paging.
These areas tend to be important to understand when working with kernel modules, especially with device drivers. A Linux system project’s sudden crash with merely a Killed
message on the console requires some explanation, yes!? The OOM killer’s likely the sweet chap behind this...
Briefly, within this chapter...