Re: 答复: [外部邮件] Re: [PATCH][rdma-next] RDMA/erdma: Use NUMA-aware allocation for MTT tables
From: Jason Gunthorpe
Date: Fri Feb 27 2026 - 09:59:52 EST
On Thu, Feb 26, 2026 at 09:09:54AM +0200, Leon Romanovsky wrote:
> So why do we need this patch? The xxx_node() functions are useful when you
> need to force allocation on a specific NUMA node. In most cases, a plain
> kmalloc() will allocate memory on the same node as 'struct erdma_dev *dev',
> which typically matches the PCI device's NUMA node.
I think a naked kmalloc allocates memory on the numa node of the
thread that calls it, which is not the dev's node.
IMHO it is best practice to allocate DMA'able memory from the NUMA
node of the struct device.
Jason