From: "Li,Rongqing(ACG CCN)" <lirongqing@baidu.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: 答复: [PATCH][rdma-next] RDMA/mlx5: Use NUMA-aware allocation for memory region descriptors
Date: Fri, 6 Mar 2026 05:23:07 +0000 [thread overview]
Message-ID: <ccaf962222eb41a6a909ec434ccb80c6@baidu.com> (raw)
In-Reply-To: <20260224090757.1761-1-lirongqing@baidu.com>
> The mlx5_alloc_priv_descs() function currently uses kzalloc(), which allocates
> memory on the NUMA node of the calling CPU. On multi-socket systems, this
> can lead to cross-node memory access if the HCA is attached to a different
> NUMA node than the process allocating the Memory Region (MR).
>
> Switch to kzalloc_node() and specify the node associated with the HCA's DMA
> device. This ensures that the MR descriptors are resident on the local NUMA
> node, reducing latency for hardware access.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
ping
[Li,Rongqing]
> ---
> drivers/infiniband/hw/mlx5/mr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index 665323b..5f4b4da 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -1990,7 +1990,8 @@ mlx5_alloc_priv_descs(struct ib_device *device,
> add_size = min_t(int, end - size, add_size);
> }
>
> - mr->descs_alloc = kzalloc(size + add_size, GFP_KERNEL);
> + mr->descs_alloc = kzalloc_node(size + add_size, GFP_KERNEL,
> + dev_to_node(ddev));
> if (!mr->descs_alloc)
> return -ENOMEM;
>
> --
> 2.9.4
next prev parent reply other threads:[~2026-03-06 5:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 9:07 [PATCH][rdma-next] RDMA/mlx5: Use NUMA-aware allocation for memory region descriptors lirongqing
2026-03-06 5:23 ` Li,Rongqing(ACG CCN) [this message]
2026-03-08 12:46 ` 答复: " Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ccaf962222eb41a6a909ec434ccb80c6@baidu.com \
--to=lirongqing@baidu.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox