From: Christoph Hellwig <hch@lst.de>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, kch@nvidia.com,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
gjoyce@linux.ibm.com
Subject: Re: [PATCH 1/2] nvmet: defer setting ns->enabled to false in nvmet_ns_disable()
Date: Fri, 18 Sep 2026 14:08:25 +0200 [thread overview]
Message-ID: <20260918120825.GA16547@lst.de> (raw)
In-Reply-To: <20260916151012.3702896-2-nilay@linux.ibm.com>
On Wed, Sep 16, 2026 at 08:39:59PM +0530, Nilay Shroff wrote:
> In nvmet_ns_disable(), keep ns->enabled set while existing namespace
> references are being drained, so namespace configuration remains blocked
> until all in-flight I/O has completed. Set ns->enabled to false only
> after the namespace references have been drained and the namespace
> device has been disabled.
>
> Since setting ns->enabled to false is deferred in nvmet_ns_disable(),
> use the NVMET_NS_ENABLED XArray mark in nvmet_req_find_ns() to
> determine whether a namespace can accept new I/O.
>
> Similarly, use the NVMET_NS_ENABLED XArray mark in nvmet_ns_disable()
> to prevent concurrent callers from starting namespace disable.
This does look sane, but have you looked at profiles if getting the
xarray tag might touch a lot more cache lines vs the flag? It might
make sense to turn enabled into an atomic bit mask and just have two
flags in there.
next prev parent reply other threads:[~2026-09-18 12:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 15:09 [PATCH 0/2] nvmet: fix subtle race in I/O processing and ns configuration Nilay Shroff
2026-09-16 15:09 ` [PATCH 1/2] nvmet: defer setting ns->enabled to false in nvmet_ns_disable() Nilay Shroff
2026-09-18 12:08 ` Christoph Hellwig [this message]
2026-09-18 15:15 ` Nilay Shroff
2026-09-16 15:10 ` [PATCH 2/2] nvmet: don't allow I/O admission after percpu ns reference is killed Nilay Shroff
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=20260918120825.GA16547@lst.de \
--to=hch@lst.de \
--cc=gjoyce@linux.ibm.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.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®