Skip to content
Commit c64be2bb authored by Marek Szyprowski's avatar Marek Szyprowski
Browse files

drivers: add Contiguous Memory Allocator



The Contiguous Memory Allocator is a set of helper functions for DMA
mapping framework that improves allocations of contiguous memory chunks.

CMA grabs memory on system boot, marks it with MIGRATE_CMA migrate type
and gives back to the system. Kernel is allowed to allocate only movable
pages within CMA's managed memory so that it can be used for example for
page cache when DMA mapping do not use it. On
dma_alloc_from_contiguous() request such pages are migrated out of CMA
area to free required contiguous block and fulfill the request. This
allows to allocate large contiguous chunks of memory at any time
assuming that there is enough free memory available in the system.

This code is heavily based on earlier works by Michal Nazarewicz.

Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarRob Clark <rob.clark@linaro.org>
Tested-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
Tested-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: default avatarRobert Nelson <robertcnelson@gmail.com>
Tested-by: default avatarBarry Song <Baohua.Song@csr.com>
parent 49f223a9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment