Re: [PATCH 05/40] dma-contiguous: add dma_get_numa_cma_area() accessor
From: Graf (AWS), Alexander
Date: Mon Nov 16 2026 - 12:05:08 EST
On 16.11.26 15:25, Graf (AWS), Alexander wrote:
> On 16.11.26 13:48, Marek Szyprowski wrote:
>> On 11.11.2026 23:41, Alexander Graf wrote:
>>> With Nitro Sandboxes, we want to allocate per-NUMA memory from the DMA
>>> contiguous allocator, but have no per-NUMA struct device to pass in.
>>> dma_alloc_contiguous() takes the node from dev_to_node(dev), and the
>>> per-node areas sit in dma_contiguous_numa_area[], which is static.
>>>
>>> So instead, introduce dma_get_numa_cma_area(), which returns the generic
>>> per-NUMA DMA CMA area that cma_alloc() would use. This way, the
>>> nitro_enclaves driver can build its own generic CMA pool per-node
>>> allocation logic on top of those pools.
>>>
>>> Signed-off-by: Alexander Graf <graf@xxxxxxxxxx>
>> Take a look at the following patch and the patchset it belongs to:
>>
>> https://lore.kernel.org/all/20261106184433.761422-5-kuba@xxxxxxxxxx/
>
> Nice! That looks very much like what I need. Thanks a lot, let me try
> and see if I can base on top of it instead.
After a closer look, I'm afraid it gets me closer, but not quite where I
need to be. I'm missing
- A way to force alignment to 2 MiB (or even 128 MiB for the larger
shared memory pool)
- Clear node pinning. I want no fallback to the global pool. The
hypervisor doesn't allow cross-NUMA donations.
- Module export, but that one's easy
How close is your patch set to final state and how much do any of the
requirements above resonate with your use case? I'm happy to punt that
discussion into the other thread and add my requirements on top, but I'm
a bit wary of doing that when my use case is subtly different.
Alex