Netdev List
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>
Cc: Carolina Jubran <cjubran@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	"Leon Romanovsky" <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	Mark Bloch <mbloch@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>, Shay Drori <shayd@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH net-next 0/2] net/mlx5: Speed up device teardown by avoiding RCU grace periods
Date: Sun, 29 Nov 2026 13:27:04 +0200	[thread overview]
Message-ID: <20261129112706.1797994-1-tariqt@nvidia.com> (raw)

Hi,

This series by Carolina reduces the time it takes to tear down an mlx5
device, which is dominated by repeated waits for RCU grace periods
during notifier unregistration.

EQ teardown unregisters IRQ notifiers one by one, and the core event
handling registers 18 separate EQ notifiers that are unregistered
individually in mlx5_events_stop(). Each unregister waits for an RCU
grace period, which adds significant latency when destroying multiple
EQs and when stopping the device.

Patch 1 switches the IRQ notifier chain to a raw notifier chain
protected by a spinlock for updates. Since the chain is walked only by
the handler of the same IRQ, synchronize_irq() after unlinking a
notifier is enough to ensure no handler still uses it, so no RCU grace
period is needed per unregister.

Patch 2 replaces the 18 per-event-type EQ notifiers registered by
mlx5_events_start() with a single NOTIFY_ANY notifier that dispatches
the events by type, so mlx5_events_stop() waits for one grace period
instead of 18.

Measured on "rmmod mlx5_ib mlx5_dpll mlx5_fwctl mlx5_core", with
rcu_expedited=0, two PFs and 72 channels per PF, patch 1 reduces the
time from 6.316 s to 4.287 s (239 to 89 synchronize_rcu() calls), and
patch 2 further reduces it to 3.878 s.

Regards,
Tariq

Carolina Jubran (2):
  net/mlx5: Avoid RCU synchronization when detaching IRQ notifiers
  net/mlx5: Use a single EQ notifier for core events

 .../net/ethernet/mellanox/mlx5/core/events.c  | 78 ++++++++++---------
 .../net/ethernet/mellanox/mlx5/core/pci_irq.c | 28 +++++--
 2 files changed, 64 insertions(+), 42 deletions(-)


base-commit: f89726ffabef1b08c52e6163b7ab94b0d5f15503
-- 
2.44.0


             reply	other threads:[~2026-11-29 11:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 11:27 Tariq Toukan [this message]
2026-11-29 11:27 ` [PATCH net-next 1/2] net/mlx5: Avoid RCU synchronization when detaching IRQ notifiers Tariq Toukan
2026-11-29 11:27 ` [PATCH net-next 2/2] net/mlx5: Use a single EQ notifier for core events Tariq Toukan

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=20261129112706.1797994-1-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    --cc=willemb@google.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