Understanding and using the kernel vmalloc() API
As we learned in the previous chapter, ultimately there is just one engine for memory allocation within the kernel – the page (or buddy system) allocator. Layered on top is the slab allocator (or slab cache) machinery. In addition to these two layers, there is another completely virtual address space within the kernel’s virtual address space from where virtual pages can be allocated at will – this is called the kernel vmalloc region.
Within the kernel segment or VAS is the vmalloc address space, aka the vmalloc region, extending from VMALLOC_START
to VMALLOC_END-1
(the precise addresses and the space available are arch-dependant; incidentally, we covered all this in some detail in Chapter 7, Memory Management Internals – Essentials, under the Examining the kernel segment section). It’s a completely virtual region to begin with, that is, its virtual pages are initially not mapped to any physical...