Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3624458pxu; Tue, 15 Dec 2020 11:14:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+xoYmOkY45br7NCII3sbIFptrlwtKz8N2JDSdNFTJYTEWc3c9H6JhSb03qm2nwEX4+U8H X-Received: by 2002:a17:906:af79:: with SMTP id os25mr28264718ejb.275.1608059682343; Tue, 15 Dec 2020 11:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608059682; cv=none; d=google.com; s=arc-20160816; b=Tf9ftd99mPkK97ZPWG6bcd4GQRf7gad4ytm9LfjgzpHhOGT52ipxp7+rxmrstv3AXg ey9r3i6xOv52UY1Du3FOqqCXpc/bLznUW23o+rZ/sw5HyaJFKgKukzcURoEq8oK3yQnK A1521D+0KTO3KSQcdZAoTeyQoFDRFBoBYZqkOqYfmSnya5TlqNRsRoXGDC7q8s+YvVBc pI8PeiOfXU/2AQVdVB4zw2kjptQ46qE0WkIXajLPMTxeLJFsVTctApIDPBufeFUzvaqj 1poFlPGV6Cokl9usIKwtHdoI4P0F/8OTGfEhf90Zqpgfm+g0KYqByQjow02jFqagFTG7 ZOgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature:dkim-signature; bh=EK1QHIxkYbOgCW7uVGbCDZ1p8urBhqb2EMvSkYyJh1I=; b=tBYorc/oY/KshkZjhoZBExeAWbmkBE43pbffdCid6QMitiuombzz/p7UzmK/9yzEKr BVS5pruUbsTXy1qUd/pC++4O1qGd58FfE0+4N80Xhb8hf1HfX4RjL71Shg1TUIAYLA/c LPH1j2zbC/Ez7zodb3fCt50i/qoeGyUf15C5+K5XiRa+ZS82Vt+flme6qaRaMZ3DdL7e vb5YEcwlTRmeXifpVCplgcW01ZnNuPMeigoeXjf7e8cRvU/4XItFyHAq7jTINPGda9cC qxVOUVAr3bDp5BnEq5xd6T7KcOKG/kHi5FzDeg6NrtAPYue4+muKTU5/fkPnBFpeWC7U VeuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm3 header.b=VTd9Ql3r; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=n6hbQ1Yl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si1354015ejc.686.2020.12.15.11.14.17; Tue, 15 Dec 2020 11:14:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm3 header.b=VTd9Ql3r; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=n6hbQ1Yl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731973AbgLOTMO (ORCPT + 99 others); Tue, 15 Dec 2020 14:12:14 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51355 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731862AbgLOTL7 (ORCPT ); Tue, 15 Dec 2020 14:11:59 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0B1145C006C; Tue, 15 Dec 2020 14:11:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 15 Dec 2020 14:11:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:subject:message-id:mime-version:content-type; s= fm3; bh=EK1QHIxkYbOgCW7uVGbCDZ1p8urBhqb2EMvSkYyJh1I=; b=VTd9Ql3r 7Hs5X4kzL3m4qvz+JA+Lp5ERIv65XIt7VKF9rRSiFKv90r+HqV1KGYvlgltIU9zN 1yOmGHIFXg099MLL7W0pQH0Z9NfL2fDiuBY5wTWltS8Fcp9o0S1fy1Kf+EYU4vK0 8k5oLzC2gUSXlNUZ9Fsfw6+U71iGEeKbAfhrrxa5KSBKsPIhU4yRmXO10/XOP2wY 8U20H1laILDRo7aS6i57Z7aZPIKcdhALKf5Pitx3Hx7MlsoXo6HG4ISq09sFas98 k2ZboyN2E3QYYgdHJuy8yTkRD7gelGiCFeJW/XlNCQDUxB5dYwHpp1+6IAwLHdFI tdFN14DcehMIZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=EK1QHIxkYbOgCW7uVGbCDZ1p8urBh qb2EMvSkYyJh1I=; b=n6hbQ1YlpZ4mN+Gu7XUcDJmdf3K50wWTGVDNGV/DhNnzl ksjD61E8+UVt4LmfV4BNEXXgmQ3hWxEL0fl5uQ6AF0z6NoOPWCtRLU6aJJbeBcsx Xj0iEZBlrj+6qjXoY5c1nnTDd+qgs61aroSuxVoyF599+x9DdDWcfri0L/akDep5 JOjPwiOI3kCGrGcQT8mxR3KY7chI3WgwOVwf9yS/gINnHK6KMgv6Yc05n9g7CtPh LKhZaMuDD29JXeCvFWISxyI0yN3BejfNoovoqd4WmyXsE/JhdgX/vXTebEKEcy9x J1VH+zK6QchXtxRK+s+zt8xKI5+n34b17k2N4+mOA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeltddguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepiedvieelgeeuuedtfeduhfefteehhfevvdeljeetgfeugfdtledtudetvdeh keffnecukfhppeeijedrudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdgu vg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 518D424005A; Tue, 15 Dec 2020 14:11:08 -0500 (EST) Date: Tue, 15 Dec 2020 11:11:06 -0800 From: Andres Freund To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Allow use of fua to be disabled on per-device basis? Message-ID: <20201215191106.egw3nitgmbhvgqxs@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have a few Samsung NVMe SSDs where FUA (i.e. REQ_FUA) is a slower than full device cache flushes (i.e. REQ_PREFLUSH). I would like to be able to disable use of FUA for those. As a first step, would it make sense to add write support to /sys/block/*/queue/fua? The biggest issue with that is that it seems like it'd be preferrable to only allow enabling fua if the underlying device supports that, and that that information isn't currently stored anywhere but QUEUE_FLAG_FUA. The easiest way to deal with that would be to split QUEUE_FLAG_FUA into QUEUE_FLAG_FUA_HW and QUEUE_FLAG_FUA_ENABLED, and have blk_queue_write_cache() set QUEUE_FLAG_FUA_ENABLED to QUEUE_FLAG_FUA_HW. Then the new blk-sysfs.c queue_fua_set() would only allow setting QUEUE_FLAG_FUA_ENABLED if QUEUE_FLAG_FUA_HW is availabl.e Does that roughly make sense? In a second step it could be reasonable to add an nvme quirks indicating slow FUA for those devices? But I'll leave that for later... Greetings, Andres Freund