mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: "Li,Rongqing(ACG CCN)" <lirongqing@baidu.com>,
	Kai Shen <kaishen@linux.alibaba.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 答复: [外部邮件] Re: [PATCH][rdma-next] RDMA/erdma: Use NUMA-aware allocation for MTT tables
Date: Thu, 26 Feb 2026 15:59:54 +0800	[thread overview]
Message-ID: <2d5e7f0a-2ea9-026e-2e79-da716a8b0a32@linux.alibaba.com> (raw)
In-Reply-To: <20260226070954.GC12611@unreal>



On 2/26/26 3:09 PM, Leon Romanovsky wrote:
> On Thu, Feb 26, 2026 at 09:50:00AM +0800, Cheng Xu wrote:
>>
>>
>> On 2/25/26 8:07 PM, Li,Rongqing(ACG CCN) wrote:
>>>
>>>>> On 2/25/26 4:51 PM, lirongqing wrote:
>>>>>> From: Li RongQing <lirongqing@baidu.com>
>>>>>>
>>>>>> Currently, MTT (Memory Translation Table) buffers are allocated
>>>>>> without NUMA awareness using kzalloc() and vzalloc(), which allocate
>>>>>> memory on the NUMA node of the calling CPU. This can lead to
>>>>>> cross-node memory access latencies if the erdma device is attached
>>>>>> to a different NUMA socket.
>>>>>>
>>>>>> Switch to kzalloc_node() and vzalloc_node() to ensure MTT buffers
>>>>>> are allocated on the local NUMA node of the PCIe device
>>>> (dev->attrs.numa_node).
>>>>>> This reduces latency for hardware access and improves performance.
>>>>>>
>>>>>> Signed-off-by: Li RongQing <lirongqing@baidu.com>
>>>>>> ---
>>>>>>  drivers/infiniband/hw/erdma/erdma_verbs.c | 4 ++--
>>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>>
>>>>>
>>>>> Hi, Li RongQing,
>>>>>
>>>>> Thanks for the patch. However, I think it is better to keep the
>>>>> current behavior, for the following reasons:
>>>>>
>>>>> 1. This path is in the control plane, so allocating memory from a remote
>>>>>    NUMA node should not have a noticeable performance impact.
>>>>
>>>> If TLB Miss , or the internal cache misses , does the HCA need to query the MTT?
>>>>
>>
>> This is rarely happen in our chip.
> 
> 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.
> 

Thanks for the detailed explanation.

> Please avoid vague phrasing like 'potentially improves performance' in the
> commit message and responses. It adds no meaningful information.
> 

Got it. 


> Also, please remove the dev->attrs.numa_node caching from erdma and rely on
> dev_to_node() instead.

OK, I will fix this.

Thanks,
Cheng Xu

> 
> Thanks

  reply	other threads:[~2026-02-26  7:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  8:51 lirongqing
2026-02-25 11:33 ` Cheng Xu
2026-02-25 11:46   ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)
2026-02-25 12:07     ` Li,Rongqing(ACG CCN)
2026-02-26  1:50       ` Cheng Xu
2026-02-26  7:09         ` Leon Romanovsky
2026-02-26  7:59           ` Cheng Xu [this message]
2026-02-27 14:55           ` Jason Gunthorpe

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=2d5e7f0a-2ea9-026e-2e79-da716a8b0a32@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=jgg@ziepe.ca \
    --cc=kaishen@linux.alibaba.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    /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

all inboxes | Powered by JetHome®