mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Qiliang Yuan <odys.yuan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet: drop the extra RCU grace period in nvmet_ns_disable()
Date: Tue, 3 Nov 2026 09:15:46 +0100	[thread overview]
Message-ID: <20261103081546.GC4301@lst.de> (raw)
In-Reply-To: <20261103-bug-nvmet-ns-disable-rcu-v1-1-ff7ac5623923@gmail.com>

On Tue, Nov 03, 2026 at 01:31:25AM -0500, Qiliang Yuan wrote:
>  	 * Now that we removed the namespaces from the lookup list, we
>  	 * can kill the per_cpu ref and wait for any remaining references
> -	 * to be dropped, as well as a RCU grace period for anyone only
> -	 * using the namespace under rcu_read_lock().  Note that we can't
> -	 * use call_rcu here as we need to ensure the namespaces have
> -	 * been fully destroyed before unloading the module.
> +	 * to be dropped.  Rely on that wait for anyone only using the
> +	 * namespace under rcu_read_lock() too: the ref can't drop to zero
> +	 * before an RCU grace period has passed since the kill.  Note that
> +	 * we can't use call_rcu here as we need to ensure the namespaces
> +	 * have been fully destroyed before unloading the module.
>  	 */
>  	percpu_ref_kill(&ns->ref);
> -	synchronize_rcu();

This assumes the percpu_ref is never moved to atomic mode otherwise.
Which we don't do in nvmet, but maybe leaving a reminder of that here
would be useful.


      reply	other threads:[~2026-11-03  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  6:31 Qiliang Yuan
2026-11-03  8:15 ` Christoph Hellwig [this message]

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=20261103081546.GC4301@lst.de \
    --to=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=odys.yuan@gmail.com \
    --cc=sagi@grimberg.me \
    /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

all inboxes | Powered by JetHome®