mm,page_alloc,cma: introduce a customisable threshold for allocating pages in cma
authorDavid Plowman <david.plowman@raspberrypi.com>
Tue, 29 Mar 2022 15:10:06 +0000 (16:10 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Tue, 29 Mar 2022 16:13:24 +0000 (17:13 +0100)
commitafb05dffd1dc983ecfa4c8a648887bb725ce5424
treed642629523f8e29b4ee58f4da0ca371cd27ef7b3
parenta51218097a20b10e4696fa19bef8bebf3833020c
mm,page_alloc,cma: introduce a customisable threshold for allocating pages in cma

On some platforms the cma area can be half the entire system memory,
meaning that allocations start happening in the cma area immediately.
This leads to fragmentation and subsequent fatal cma_alloc failures.

We introduce an "alloc_in_cma_threshold" parameter which requires that
this many sixteenths of the free pages must be in cma before it will
try to use them. By default this is set to 12, but the previous
behaviour can be restored by setting it to 8 on startup.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
mm/page_alloc.c