On 2026-11-12 9:53 am, Paolo Abeni wrote:
On 11/6/26 19:44, Jakub Kicinski wrote:
quoted
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -642,6 +642,13 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);
* Same as dma_alloc_attrs() but places the memory on @node rather than on the
* node of @dev. Like with kmalloc_node() the node is only a preference,
* the page allocator may fall back to other nodes if @node is out of memory.
+ * The contiguous memory allocator (CMA) does not: only the CMA area of @node
+ * and the global CMA area are tried. The allocation may fail even though the
+ * CMA area of another node, e.g. that of @dev, still has free space.
+ *
+ * Allocations served from per-device or global coherent pools, per- device CMA
+ * areas, restricted or atomic pools, arch_dma_alloc() or dma_map_ops
+ * implementations do not take @node into account.
I'm possibly over-thinking here, but AFAICS there are a bunch of dma_map_ops that
are using dev_to_node():
dma_iommu_alloc_coherent() in arch/powerpc/kernel/dma-iommu.c
vio_dma_iommu_alloc_coherent() in arch/powerpc/platforms/pseries/vio.c
gart_alloc_coherent() in arch/x86/kernel/amd_gart_64.c
With this series they will stop using the driver provided numa node.
Probably not a blocker but possibly worth to call out?
Nothing "stops" - this series adds a *new* interface by which drivers can now indicate a specific preferred node, but DMA API backends are still free to ignore the caller-provided hint and continue doing whatever they want. This is already called out all over the series in commit messages, documentation and comments including the one above.
If anyone does want to do the additional work to wire this up through dma_map_ops for powerpc's benefit (I doubt the rest of the legacy/embedded architectures will ever care), they will be welcome to do so. But as-is, all that happens is that the driver changes here have no effect on those systems and will keep working just as they did before.
Thanks,
Robin.