In this section, you will learn about two aspects of the Linux kernel's primary (de)allocator engine:
- First, we will cover the fundamentals of the algorithm behind this software (called the buddy system).
- Then, we will cover the actual and practical usage of the APIs it exposes to the kernel or driver developer.
Understanding the basics of the algorithm behind the page allocator is important. You will then be able to understand the pros and cons of it, and thus, when and which APIs to use in which situation. Let's begin with its inner workings. Again, remember that the scope of this book with regard to the internal memory management details is limited. We will cover it to a depth deemed sufficient and no more.