Re: [RFC] OOM on unmovable kernel allocations with large free CMA (no non-CMA -> CMA migration)

From: Michal Hocko

Date: Thu Dec 03 2026 - 13:25:20 EST


Sorry for cutting your message somehow aggressively but I suspect that
with the current CMA semantics there is not really much you can do about
your problem. You have reservations and expect you size them to your
known users. From that POV you are effectively creating a restricted
resource (similar to 32b low/high mem situation). You can (ab)use CMA
ranges for movable allocations as an optimization but at the end of the
day those need to be migrateable away to preserve the original intention
for the CMA.

On Thu 03-12-26 17:58:37, tarunsahu@xxxxxxxxxx wrote:
> 3. Reclaim (shrink_folio_list() / kswapd / direct reclaim) has no path
> to migrate ordinary movable pages from non-CMA ZONE_NORMAL into free
> CMA pageblocks when non-CMA is exhausted. Without swap (or before
> swap-out makes progress), the zone is declared all_unreclaimable and
> the OOM killer fires despite large free_cma.

So what happens when you have your real CMA user to request the reserved
CMA and it is occupied by movable allocation that simply cannot be moved
because there is no target to move it.

In other words isn't this just moving the problem around?
--
Michal Hocko
SUSE Labs