From: Nilay Shroff <nilay@linux.ibm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: 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 20:45:46 +0530 [thread overview]
Message-ID: <8895ba88-a870-483d-96e2-08ee3fba3198@linux.ibm.com> (raw)
In-Reply-To: <20260918120825.GA16547@lst.de>
On 9/18/26 5:38 PM, Christoph Hellwig wrote:
> 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.
Yes, you were correct. Using the XArray mark in the I/O path touches
significantly more cache lines.
I'll fix this as you suggested by using atomic bit flags and send out
the next revision.
Thanks,
--Nilay
next prev parent reply other threads:[~2026-09-18 15:16 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
2026-09-18 15:15 ` Nilay Shroff [this message]
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=8895ba88-a870-483d-96e2-08ee3fba3198@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=gjoyce@linux.ibm.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--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®