From: Tariq Toukan <tariqt@nvidia.com>
To: Yi Li <liyi@hygon.cn>, Saeed Mahameed <saeedm@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>,
Leon Romanovsky <leon@kernel.org>, Mark Bloch <mbloch@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/mlx5: Update mlx5_irq.mask when IRQ affinity changes
Date: Sun, 17 May 2026 11:58:27 +0300 [thread overview]
Message-ID: <99c99bde-9800-4a5e-b8a1-7cc472af52cd@nvidia.com> (raw)
In-Reply-To: <20260514074208.23353-1-liyi@hygon.cn>
On 14/05/2026 10:42, Yi Li wrote:
> mlx5_irq.mask is used for:
> 1) Setting IRQ affinity_hint in mlx5_irq_alloc()
> 2) Determining mlx5e_channel.cpu in mlx5e_open_channel(), which in turn
> decides the NUMA node for queue allocations.
>
> When a user modifies IRQ affinity, mlx5_irq.mask remains unchanged.
> Consequently even if mlx5e_open_channel() is invoked again, queues are
> still allocated on the original NUMA node instead of the newly
> preferred one.
>
> Fix this by registering an irq_set_affinity_notifier to update
> mlx5_irq.mask when /proc/irq/N/smp_affinity is modified.
> Therefore subsequent queue allocations reflect the updated affinity.
>
> Signed-off-by: Yi Li <liyi@hygon.cn>
> ---
Hi,
Thanks for the patch. Looking at the proposal, I want to discuss two
distinct aspects:
NAPI Execution Location: We already track effective affinity closely
through irq_get_effective_affinity_mask(); NAPI processing is
dynamically moved accordingly, including a forced NAPI cycle break if
needed.
Memory Allocation Location: This is the core focus of your patch.
I have serious comments on the proposed implementation, but first I want
to discuss the idea.
We investigated a similar approach a few years ago but ultimately
decided against upstreaming it due to stability concerns:
High Volatility: The "current affinity" value can be extremely dynamic,
potentially shifting multiple times per second depending on system load
and tuning.
Performance Risk: Sampling a highly volatile "current" value to allocate
relatively permanent resources (like channel queues) risks severe
worst-case performance regressions if the affinity shifts immediately
after allocation.
Because of this, we have historically relied on numa-distance logic for
channel allocations to ensure a predictable baseline.
Do you have any benchmark data or specific use cases showing a clear net
benefit over the existing numa-distance logic?
Best regards,
Tariq
next prev parent reply other threads:[~2026-05-17 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 7:42 Yi Li
2026-05-17 8:58 ` Tariq Toukan [this message]
2026-05-20 7:18 ` Yi Li
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=99c99bde-9800-4a5e-b8a1-7cc472af52cd@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=liyi@hygon.cn \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.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®