Re: [PATCH v2 3/3] cma: move memory allocation to a helper function

From: Oscar Salvador
Date: Thu Jul 03 2025 - 14:58:06 EST


On Thu, Jul 03, 2025 at 09:47:11PM +0300, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx>
>
> __cma_declare_contiguous_nid() tries to allocate memory in several ways:
> * on systems with 64 bit physical address and enough memory it first
> attempts to allocate memory just above 4GiB
> * if that fails, on systems with HIGHMEM the next attempt is from high
> memory
> * and at last, if none of the previous attempts succeeded, or was even
> tried because of incompatible configuration, the memory is allocated
> anywhere within specified limits.
>
> Move all the allocation logic to a helper function to make these steps more
> obvious.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

Acked-by: Oscar Salvador <osalvador@xxxxxxx>

Thanks Mike ;-)!



--
Oscar Salvador
SUSE Labs