Linux kernel memory management part is the 2nd most complicated part to understand in the Linux kernel but it is that much interesting as well. Best approach to learn it would be to read the code. But obviously one can’t start reading the code randomly without knowing the terms and what exactly is happening in the current mm part. So, just to start from, I would go like this:
Read the current LSF/MM notes: The 2016 Linux Storage, Filesystem, and Memory-Management Summit . LSF/MM is the annual Linux Storage, Filesystem and Memory Management Summit. It is an invite only event and people usually discusses about their plans and projects for the next year. One can go for reading about past years’ LWN summit reports as well. Some kernel developers writes separate blogs on this summit as well.
Now, while going through these notes, one will surely have many questions. And those can be found on these sites. Usually google search definitely helps. But I am just listing some standard sites for the reference:
- LinuxMM - linux-mm.org Wiki
- Understanding the Linux Virtual Memory Manager(Nice book but somehow old. Looking at code while reading can definitely help to understand how things are changed over the years.)
- Blogs of the kernel developers who are working in the mm part of the kernel: Rik van Riel’s home pageand Mel Gorman
- Kernel coverage at LWN.net (I found these articles very useful. They are the best documentation I have ever come across. On most of the topics I have seen that articles are written over the years which are helpful to understand how things are changing in the kernel).
- Kernel documentation
- Along with reading, make sure that you look at the code and try to understand how it works. There is an IRC channel #mm on OFTC server. You can ask questions related to memory management part of the kernel.
- Usually while reading the code, if I don’t understand anything I use
git blame. Specifically in the mm part, developers are used to write detailed commit log (with the test cases/programs)so that they and others can refer it in the future. Most of the time I have found them useful for understanding any mm code.
- And last but not least, play with the code. Try to experiment with it and testing it by changing the code. The more you play, more you will understand.