The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
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 14:05:59 +0300	[thread overview]
Message-ID: <20260709110559.GQ15188@unreal> (raw)
In-Reply-To: <20260709095921.5g994Mie@linutronix.de>

On Thu, Jul 09, 2026 at 11:59:21AM +0200, Sebastian Andrzej Siewior wrote:
> 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.

hfi1 has an rcu_barrier() call in hfi1_free_devdata():
https://elixir.bootlin.com/linux/v7.1.2/source/drivers/infiniband/hw/hfi1/init.c#L1176

Thanks

  reply	other threads:[~2026-07-09 11:06 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 ` [PATCH rdma-rc 0/3] RDMA: Prevent RCU callbacks from outliving modules Sebastian Andrzej Siewior
2026-07-09 11:05   ` Leon Romanovsky [this message]
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=20260709110559.GQ15188@unreal \
    --to=leon@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=jgg@ziepe.ca \
    --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