Re: [RFC PATCH] mm/cma: don't release CMA pages still in use

From: Rik van Riel

Date: Sun Aug 09 2026 - 23:16:49 EST


On Sun, 2026-08-09 at 21:06 -0400, Rik van Riel wrote:
>
> This change should be safe because nothing can get reallocated while
> it
> is still in use.

And of course Sashiko found something I overlooked.

I'll spin a v2 tomorrow.

https://sashiko.dev/#/patchset/20260809210608.06b5ccb9@fangorn

The hugetlb CMA code uses order 9 as the smallest
size that may be returned to the CMA allocator,
which I suppose works because when mTHPs, THPs,
and other movable large folios end up in the hugetlb
CMA area, those do not go through the CMA allocator,
and never touch the bitmap?

That additional bitmap alongside of the pages and
page blocks looks like trouble.