Re: [PATCH 0/2] mm/cma: accept memory of CMA areas reserved with memblock_reserve()
From: Mike Rapoport
Date: Thu Oct 29 2026 - 08:42:30 EST
On Thu, Oct 29, 2026 at 12:27:23PM +0000, Kiryl Shutsemau wrote:
> On Thu, Oct 29, 2026 at 12:18:36PM +0200, Mike Rapoport (Microsoft) wrote:
> > Pages of allocated CMA areas are released to the buddy allocator with
> > __free_pages(), which does not check for unaccepted memory.
> >
> > This usually works because memblock accepts the memory it allocates.
> >
> > However, multi-range CMA areas, used by hugetlb_cma, and fixed CMA areas
> > requested with cma=<size>@<base> are reserved with memblock_reserve() and
> > their memory is never accepted.
>
> It feels like memblock_reserve() abuse, no?
>
> crashkernel=size@base already uses memblock_phys_alloc_range() for this.
> Should the fixed and multi-range CMA paths go through the allocation API
> as well.
Fixed path already has the range, why would it use allocation APIs?
The multi-range could, but it will be several times slower and I believe
the intention was to avoid allocation APIs exactly because of that.
> --
> Kiryl Shutsemau / Kirill A. Shutemov
--
Sincerely yours,
Mike.