Re: [PATCH v2] dma-contiguous: support percentage sizes in cma_pernuma= and numa_cma=

From: Jason Gunthorpe

Date: Fri Nov 20 2026 - 14:12:49 EST


On Thu, Nov 19, 2026 at 12:27:08PM +0000, Graf (AWS), Alexander wrote:

> Ideally all of this would be policy that only takes effect later at
> boot, so that we don't require pre-boot logic or a reboot. For this to
> work, we would need to have Linux restrict its memory allocations to a
> small'ish region instead of spreading them, maybe to the KHO scratch
> region, or maybe by favoring allocations in phys addr order. At least
> until the boot is at a point where you could perform the allocation. And
> then we would also have large physically contiguous blocks available to
> allocate from and potentially change the tag to CMA.

That actually seems like a sort of reasonable idea...

What about the reverse, you boot with a huge CMA and then shrink it in
the initrd to what you really want? For this you'd just want some
command line indicating how much non-CMA memory to have, which should
be fairly predictable to get into the initrd?

Jason