Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net/mlx5: Speed up device teardown by avoiding RCU grace periods
@ 2026-11-29 11:27 Tariq Toukan
  2026-11-29 11:27 ` [PATCH net-next 1/2] net/mlx5: Avoid RCU synchronization when detaching IRQ notifiers Tariq Toukan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tariq Toukan @ 2026-11-29 11:27 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Willem de Bruijn
  Cc: Carolina Jubran, Gal Pressman, Leon Romanovsky, linux-rdma,
	Mark Bloch, Saeed Mahameed, Shay Drori, Tariq Toukan

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-29 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 11:27 [PATCH net-next 0/2] net/mlx5: Speed up device teardown by avoiding RCU grace periods Tariq Toukan
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
2026-11-29 11:33 ` [PATCH net-next 0/2] net/mlx5: Speed up device teardown by avoiding RCU grace periods sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox