Since the beginning, the kernel has always used a very simple memory allocator (purely page based) because I wanted to focus on funcionality more than in efficiency. Due that most of the internal structures and arrays have a fixed size, such simple memory allocator has served well and has been enough for the majority of cases.
Future changes in the kernel though will need a more fine grained memory allocator, and that made me decide to start thinking that it has arrived the time to change to a more efficient kernel memory allocator. I have read some books, articles and blogs on the subject but I found no one as clear and concise as the Lecture 27, Dynamic Storage Allocation, by Douglas W. Jones.
So, during the last weeks I have been working on the new kernel memory allocator based on the well know Buddy system algorithm, and yesterday I finally was able to push the commit that makes this possible. This budddy algorithm will manage memory requests smaller than
There is a new file called
/proc/buddyinfo to help to keep track, in real time, the performance of the Buddy system algorithm.
The following is a video that shows the program I used to test the new algorithm to make sure it works as expected: