mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
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 v2] nvmet: drop the extra RCU grace period in nvmet_ns_disable()
Date: Wed, 4 Nov 2026 09:35:11 -0700	[thread overview]
Message-ID: <autev0xlCzBMz7SC@kbusch-mbp> (raw)
In-Reply-To: <20261104-bug-nvmet-ns-disable-rcu-v2-1-b158a59318ad@gmail.com>

On Wed, Nov 04, 2026 at 01:31:28AM -0500, Qiliang Yuan wrote:
> nvmet_ns_disable() kills the namespace's percpu ref, waits in
> synchronize_rcu() for anyone looking the namespace up under
> rcu_read_lock(), and then waits for the ref to drop to zero.
> 
> Killing a percpu ref that is still in percpu mode, as the namespace
> ref always is until then, switches it to atomic mode from an RCU
> callback, so the ref can't drop to zero before a grace period has
> passed since the kill. synchronize_rcu() thus adds a second grace
> period in a row, about 4 ms here, and disabling the namespaces of a
> subsystem one by one takes about 9 ms each.
> 
> Drop synchronize_rcu() and rely on the wait for the ref to cover the
> RCU readers as well.

Thanks, applied to nvme-7.4.

      parent reply	other threads:[~2026-11-04 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  6:31 Qiliang Yuan
2026-11-04  7:14 ` Christoph Hellwig
2026-11-04 16:35 ` Keith Busch [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=autev0xlCzBMz7SC@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=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®