Re: [PATCH] mm/cma: fix handling of free ranges that cross 4G for multi-range areas
From: David Hildenbrand (Arm)
Date: Wed Dec 02 2026 - 07:44:08 EST
On 12/2/26 12:39, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx>
>
> Multi-range CMA areas are placed only above 4G. cma_find_free_range()
> enforces this by skipping free ranges that start below 4G, including the
> ranges that cross 4G.
>
> On systems where RAM is contiguous across 4G, like QEMU arm64 virt
> machines with more than 3G of RAM, the largest free range of a node may
> cross 4G. When hugetlb_cma falls back to a multi-range area, it cannot
> use any part of that range and the reservation fails if the remaining
> ranges are too small.
>
> Use the part of such ranges above 4G instead of skipping them.
>
> Comparing a phys_addr_t with SZ_4G causes warnings on 32-bit builds, so
> make cma_find_free_range() a stub that returns 0.
>
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://sashiko.dev/bug/linux-59c2cbb5-4dcf-49a5-90c2-72f5b734d510
> Fixes: c009da4258f9 ("mm, cma: support multiple contiguous ranges, if requested")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David