Re: [PATCH v3 0/3] mm: hugetlb: fix CMA-related issues

From: David Hildenbrand (Arm)

Date: Wed Nov 11 2026 - 17:12:18 EST


On 11/7/26 11:30, Qi Zheng wrote:
> From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
>
> Hi all,
>
> This series fixes three CMA-related issues in HugeTLB reservation,
> long-term pinning and allocation:
>

Can I hand you over another CMA-related hugetlb problem?

On arm64, we can end up allocating 1GiB and 32MiB hugetlb folios from the cma
region.

Doing that dynamically is not a problem. Doing it during boot doesn't quite work.

cma_reserve_early() does not handle any kind of alignment.

So if you allocate a 32M folio followed by a 1G folio, the 1G folio will
suddenly start at offset 32M, not being naturally aligned in physical address space.

Likely cma_reserve_early() must be taught to align (and maybe consume an order
instead of a size), similar to how the dynamic cma allocations work.

--
Cheers,

David