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)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:20 +0000 (11:33 +0000)
commit05f160e58b8841f9afeb9f91717b651a8ee4807f
treeca98e77ffb2cbfc9e282f86eac7de1268e9baf6e
parent1527388ed27ec7965307054426f028b4668dc5f3
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