From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Leon Romanovsky <leon@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Petr Pavlu <petr.pavlu@suse.com>,
"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH rdma-rc 0/3] RDMA: Prevent RCU callbacks from outliving modules
Date: Thu, 9 Jul 2026 11:59:21 +0200 [thread overview]
Message-ID: <20260709095921.5g994Mie@linutronix.de> (raw)
In-Reply-To: <20260709-unload-rcu-v1-0-fccd27211e5a@nvidia.com>
On 2026-07-09 12:06:46 [+0300], Leon Romanovsky wrote:
> ib_core, mlx5_ib, and ib_ipoib use call_rcu() with callbacks implemented by
> their modules. Stopping callback producers does not drain callbacks already
> queued. If module unload completes first, RCU can later invoke code that has
> been unloaded. synchronize_rcu() and SRCU waits do not wait for queued
> callbacks.
>
> IPoIB reclamation completions are signaled from inside the callbacks, so
> they can wake teardown before a callback returns. Initialization unwind
> also needs protection because registration can attach existing devices and
> undo their setup on failure.
>
> Wait for queued callbacks after all producers have stopped.
>
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Closes: https://lore.kernel.org/linux-rdma/20260708092316.Qb39F_B0@linutronix.de/
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Thank you. This makes sense. drivers/infiniband/hw/hfi1 might need the
same.
However, we do have a little conversation thinking about moving
rcu_barrier() into the module core code but nothing has been decided so
far. I'm trying to figure out how many might be affected by this.
Sebastian
next prev parent reply other threads:[~2026-07-09 9:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 9:06 [PATCH rdma-rc 0/3] RDMA: Prevent RCU callbacks from outliving modules Leon Romanovsky
2026-07-09 9:06 ` [PATCH rdma-rc 1/3] RDMA/core: Wait for RCU callbacks before unloading ib_core Leon Romanovsky
2026-07-09 9:06 ` [PATCH rdma-rc 2/3] RDMA/mlx5: Drain RCU callbacks during module teardown Leon Romanovsky
2026-07-09 9:06 ` [PATCH rdma-rc 3/3] RDMA/ipoib: " Leon Romanovsky
2026-07-09 9:59 ` Sebastian Andrzej Siewior [this message]
2026-07-09 11:05 ` [PATCH rdma-rc 0/3] RDMA: Prevent RCU callbacks from outliving modules Leon Romanovsky
2026-07-09 11:59 ` Sebastian Andrzej Siewior
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=20260709095921.5g994Mie@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=petr.pavlu@suse.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