Deep Dive into Contiguous Memory Allocator
Posted by Michał ‘mina86’ Nazarewicz on 10th of June 2012 | (cite)
This is an extended version of an LWN article on CMA. It contains more detail on how to use CMA and a lot of boring code samples.
Contiguous Memory Allocator (or CMA) has been developed to allow large physically contiguous memory allocations. By initialising early at boot time and with some fairly intrusive changes to Linux memory management, it is able to allocate large memory chunks without a need to grab memory for exclusive use.
Simple in principle, it grew to be a quite complicated system which requires cooperation between boot-time allocator, buddy system, DMA subsystem, and some architecture-specific code. Still, all that complexity is usually hidden away and normal users won’t be exposed to it. Depending on perspective, CMA appears slightly different and there are different things to be done and look for.