This presentation demonstrates how to use Contiguous Memory Allocator in device drivers an how to integrate it with the DMA subsystem. It also describes basic principles of how CMA works. It is aimed at maintainers who wish to add CMA support to their platforms, but should be of interest to device driver authors as well.
The rise of smart phones makes Linux inability to allocate big physically contiguous memory blocks more apparent then ever. The standard allocator is capped at 4 MiB blocks while at the same time a 5 megapixel camera requires 15 MiB of memory. IO MMU and vectored I/O would solve the problem but are not always available and often infer performance penalty. CMA has been designed to solve the problem by migrating pages when big memory buffers are needed. This approach makes permanent memory reservations unnecessary.