From: Jason Gunthorpe <jgg@nvidia.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rdma@vger.kernel.org, Leon Romanovsky <leonro@nvidia.com>,
Petr Pavlu <petr.pavlu@suse.com>,
"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [Q] RCU usage in infiniband
Date: Wed, 8 Jul 2026 10:28:49 -0300 [thread overview]
Message-ID: <20260708132849.GC674038@nvidia.com> (raw)
In-Reply-To: <20260708132105.5c0kDr8S@linutronix.de>
On Wed, Jul 08, 2026 at 03:21:05PM +0200, Sebastian Andrzej Siewior wrote:
> On 2026-07-08 10:17:27 [-0300], Jason Gunthorpe wrote:
> > On Wed, Jul 08, 2026 at 11:23:16AM +0200, Sebastian Andrzej Siewior wrote:
> > > Hi,
> > >
> > > I've been randomly starting at infiniband code and noticed it uses
> > > call_rcu() with a callback from its module.
> > >
> > > | drivers/infiniband/hw/mlx5/devx.c: call_rcu(&event_sub->rcu, devx_free_subscription);
> > > | drivers/infiniband/ulp/ipoib/ipoib_main.c: call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
> > >
> > > I don't see synchronize_rcu() and rcu_barrier() there so I've been
> > > asking myself what ensures that the callback completes before module is
> > > gone (via rmmod)? I would expect a rcu_barrier() in
> > > ipoib_cleanup_module() for instance.
> > >
> > > Is the unload path so "late" that the callbacks run before the module is
> > > unmapped or is there something between the APIs that ensures this?
> >
> > It wouldn't hurt to have a more explicit unload synchronize call, but
> > there are already some existing ones on the path to unload a module
> > that would cover anyhow
>
> Where? Within the module core or somewhere within infiniband?
Eg the uverbs path has a srcu synchronize IIRC before allowing the FDs
to close which holds the module as well. But it probably isn't wise to
rely on this
Jason
next prev parent reply other threads:[~2026-07-08 13:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 9:23 [Q] RCU usage in infiniband Sebastian Andrzej Siewior
2026-07-08 13:17 ` Jason Gunthorpe
2026-07-08 13:21 ` Sebastian Andrzej Siewior
2026-07-08 13:28 ` Jason Gunthorpe [this message]
2026-07-08 13:34 ` Sebastian Andrzej Siewior
2026-07-08 13:58 ` Paul E. McKenney
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=20260708132849.GC674038@nvidia.com \
--to=jgg@nvidia.com \
--cc=bigeasy@linutronix.de \
--cc=leonro@nvidia.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.