Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Erwan Velu <erwanaliasr1@gmail.com>
Cc: Erwan Velu <e.velu@criteo.com>,
	linux-nvme@lists.infradead.org, axboe@kernel.dk, hch@lst.de,
	sagi@grimberg.me, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme: honor the volatile write cache enable state
Date: Mon, 30 Nov 2026 12:34:33 -0700	[thread overview]
Message-ID: <aw3PyddKScCmV-Tv@kbusch-mbp> (raw)
In-Reply-To: <CAL2JzuzOWqTmNbvk_0NLNPBrTHVN51tXeZX=ktPKLbBbyPrgLg@mail.gmail.com>

On Mon, Nov 30, 2026 at 06:10:14PM +0100, Erwan Velu wrote:
> [...]
> > There's just a gap with the multipath head: if you start up with WCE
> > cleared, then turn it on, the head isn't updated to indicate flush
> > limits. Let's get that fixed, then I'll queue this up.
> Hi Keith,
> 
> Back to this, I'll work on a v2.
> 
> Before I do, I want to be sure I fix the right gap. With a single
> controller, my understanding is that the head does pick up the change:
> the Set Features triggers a rescan that we wait for, nvme_update_ns_info()
> commits BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA on the path, then stacks it
> on the head with queue_limits_stack_bdev(), and blk_stack_limits()
> inherits both flags through BLK_FEAT_INHERIT_MASK.
> 
> The gap I can see is with several controllers in the subsystem: the
> Set Features only refreshes the controller it was sent to. The other
> controllers keep WCE cleared, so their paths stay write-through. The head
> is write-back, but a flush or FUA write routed through one of those
> paths has REQ_PREFLUSH/REQ_FUA stripped by submit_bio_noacct(), so it
> never reaches the device.
> 
> There is also the opposite direction: since stacking only ORs the
> inherited features, once the head is write-back it stays write-back
> after WCE is cleared. It is harmless for data integrity, but the head
> keeps reporting a write-back cache.
> 
> Is the multi-controller case what you had in mind? If so, for v2 I plan
> to refresh the WCE state and rescan every controller of the subsystem
> after a successful Set Features, waiting for the rescans when the cache
> gets enabled. Should I also recompute the head write cache features from
> all the paths, so that clearing WCE is reflected on the head as well?

You're right about the single controller case for the off->on transtion,
I was mistaken there. The on->off transition will show the wrong thing
on the head, but I think that's mostly harmless.

Your multi-controller question turned up an existing problem when WCE is
turned on: the spec says a Flush only covers commands completed by the
controller it's sent to, but multipath sends it down only one path.
Writes completed through another controller path aren't necessarily made
durable.

So sorry again, I think I really do have something to fix up ahead of
your patch.


      reply	other threads:[~2026-11-30 19:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 14:12 [PATCH] nvme: honor the volatile write cache enable state Erwan Velu
2026-10-16 16:57 ` Keith Busch
2026-10-16 17:15   ` Erwan Velu
2026-10-16 17:27     ` Keith Busch
2026-10-16 17:43       ` Erwan Velu
2026-10-16 17:55         ` Keith Busch
2026-10-17  4:25           ` Erwan Velu
2026-10-22 13:27             ` Erwan Velu
2026-10-22 23:17               ` Keith Busch
2026-10-23 14:53                 ` Erwan Velu
2026-10-28 16:08                   ` Keith Busch
2026-10-28 16:16                     ` Christoph Hellwig
2026-10-28 17:08                     ` Erwan Velu
2026-10-28 17:47                       ` Keith Busch
2026-11-26 10:07                     ` Erwan Velu
2026-11-30 16:01                       ` Keith Busch
2026-11-30 17:10                     ` Erwan Velu
2026-11-30 19:34                       ` 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=aw3PyddKScCmV-Tv@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=e.velu@criteo.com \
    --cc=erwanaliasr1@gmail.com \
    --cc=hch@lst.de \
    --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