From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F530606A320 for ; Mon, 30 Nov 2026 19:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EQu6N0w+; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BFGs+r9A DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=Jj3IbrKLY1teEJF41KErspMy9v06Lmphx47EvnLjZtA=; b=EQu6N0w+L85tAMBs6oiPFszUTB 8MlDywJSZ1WQJxYQZka3H8f1i5ZZcelHf8jz/CwbApErf1c8VLCrdmQzZYzT+ej85YC92iyGbeeuY FM6iBx5a46npCT5RvTtDvSEtDHKKGP9f3Z6aA6J2FioxPQWqf3etdDDE/AYlwl1Ur/A0oBOl7igs7 3HjItqw6EqrC/F6LL1BfM6qchJWmAAKBiXQ8skm+L87bc5G9udCcYmICb2q89eIhw/IscQZNBQYGp +ty4ctC2CJ3Ez9s6jDC90V7EOZDJVsScL4bXL2BRttM22N373av/Kbjq3ya7lr0HGyKsTDcmLoBsJ xB9nXWhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY796-00000005k2D-0GuO; Mon, 30 Nov 2026 19:34:40 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY792-00000005k1z-2USA for linux-nvme@lists.infradead.org; Mon, 30 Nov 2026 19:34:38 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 9B2B9605C5; Mon, 30 Nov 2026 19:34:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECE0D1F00896; Mon, 30 Nov 2026 19:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796067275; bh=Jj3IbrKLY1teEJF41KErspMy9v06Lmphx47EvnLjZtA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=BFGs+r9A/CRuWef/3O+RF4X2PhIAHLGFb0e08Q2hO7geykgElioWRG5eydU89yyeu 0CLWg+VVLrxBFFqMXvi113j7M/r/5bg94gF5Cy0xDotdZFQlB9FVFaT1wA0tFaexIZ jAM6ttd7ncCPF3j4ALZePfMBkrrrWDTxAAFtyMC7ErGZRdRJvTpQDLroNx1pwHe66n CIAMlKUSuT9On0hSOyZtl7cKP+B6sr/xjypIHGxC5qmrY8E4o2gr4zkMWKwlxevzqU vdUwtQV1IdtC5ilEItDi2sVOgxUE4Kz152Enq9sXB3DLjxXVoXQ6j+veQ+G38g7VuJ 74SPw8ir+A1mQ== Date: Mon, 30 Nov 2026 12:34:33 -0700 From: Keith Busch To: Erwan Velu Cc: Erwan Velu , 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 Message-ID: References: <7fec6534-9e57-4041-8699-72c5950c7e2a@criteo.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.