Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1469038rdb; Wed, 6 Dec 2023 22:51:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHrW1xHELP7hNz5vNliErIx5AzSSB3Iw8FCRpHlDpbedu+EShzbhPQ3LXDS/DpYBfGh5iy X-Received: by 2002:a50:85c3:0:b0:54c:d2:ea39 with SMTP id q3-20020a5085c3000000b0054c00d2ea39mr1169699edh.18.1701931894943; Wed, 06 Dec 2023 22:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701931894; cv=none; d=google.com; s=arc-20160816; b=saS0jWmh6dWJWX44WGJGB43fPpT9kdQRJrc4MLb4Wv0eVTImHFzjCI3SF6XwoCHY2K I0sCShjUjbHR+Eqz3pUdUreCutedTfz6dBsIbnGIjwYJ7OrZhgoOW4WAD+Ph2HHwU4eh prWxFSRLSpz05piG83/hvuv1JKGuRRYQz3a/ODo10bx0/RtDj2jeZurIPdSpzDPtCCSC +cv6U2TYLZwxswPpYp7hvIfmA0NmF2bAvYWmifBzIxhCH2lbMSSEOlmCxRkKcAdX3I7E 3BHrvepqz1YncsV+B4kN6SBDmOA8iAZm1p+kLgZ5ndeaidsCPkuEEfl3/x8oX1jNTYEk jcmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UfL2KoGggpRyXRxC/oRG3Gv/LsdkC3Op4OluyeXF4F4=; fh=qLfvHKceOa7U/wZj5ZDBHHxD14dvuA1MWUdGWQ/QrJA=; b=0GiwEc2dgEEtFjI5osubdg6EziUrcWLLVXPGaQ0gD1oI9en1tg49+csGhQ8+XNlmwF w6EThvojvY3AzTwfuMJNrt6pOAmzw3fctLUQ92pRhWsSV45akQ3LuJnLSqoBTRyuxYvB OHMx0Vjjg0MteaEepmUZKpuf9J5Be5ft3I/fVmOPLDbqt7fgYS5XW8ykJp2VITasyu+Z omVLqv/VIvHvKA5j37DJrKxWVIDFYpKI1XM5XrLX5bxeuqkzk5NdMhHTiNBg2dIUvhmC XlV/MwOxu4sUprJJOAt/L+DQZrTTwYgBWsjmJP5892NA1P6Xu2L7GSJLhxVmJA/F/pOq CFkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=AQCvEWvZ; spf=pass (google.com: domain of linux-ext4+bounces-330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c3-20020a50f603000000b0054c90700948si351497edn.321.2023.12.06.22.51.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 22:51:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=AQCvEWvZ; spf=pass (google.com: domain of linux-ext4+bounces-330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B00951F21306 for ; Thu, 7 Dec 2023 06:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A02D613AFD; Thu, 7 Dec 2023 06:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="AQCvEWvZ" X-Original-To: linux-ext4@vger.kernel.org Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6766710C9 for ; Wed, 6 Dec 2023 22:51:05 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-122-214.bstnma.fios.verizon.net [173.48.122.214]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 3B76ok0S000645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Dec 2023 01:50:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1701931849; bh=UfL2KoGggpRyXRxC/oRG3Gv/LsdkC3Op4OluyeXF4F4=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=AQCvEWvZ1ZNDqePQ7Faykh3MytTg4T3BXLjg8+ksZvjZdje+pz1Z5L037V5TD0reI rziH1mKOVt8Gh2vp9GOv/C2EdeONUx9PBVIqL5nOX0h9eoDoBawLPZ6ZD5u9hKAVQJ 4Cg+ajzFVtW1wcgO4bBRYoWsZP4Sj3jvBD2qN3noneD+RA2cnkJhyE2uJII0gT1g4s AJ0MrEskqHXgAZEMI/JYzkyPRVexOUt7Cv0WlC8VEHiOg0hbwwkiSAUYPIle5JlC/1 CysBCcPqOGppMQtHU0FO5Tb9F5IDy4GFp3wNV7p89D3izxsya6h4s0CIBongQGtAOz XrQ4be/Nwl/fA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id AE0E215C057B; Thu, 7 Dec 2023 01:50:46 -0500 (EST) Date: Thu, 7 Dec 2023 01:50:46 -0500 From: "Theodore Ts'o" To: Dave Chinner , hch@lst.de, Christian Brauner , "Darrick J. Wong" , Jan Kara Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] [RFC] iomap: Use FUA for pure data O_DSYNC DIO writes Message-ID: <20231207065046.GA9663@mit.edu> References: <20180301014144.28892-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180301014144.28892-1-david@fromorbit.com> On Thu, Mar 01, 2018 at 12:41:44PM +1100, Dave Chinner wrote: > From: Dave Chinner > > If we are doing direct IO writes with datasync semantics, we often > have to flush metadata changes along with the data write. However, > if we are overwriting existing data, there are no metadata changes > that we need to flush. In this case, optimising the IO by using > FUA write makes sense. > > We know from teh IOMAP_F_DIRTY flag as to whether a specific inode > requires a metadata flush - this is currently used by DAX to ensure > extent modi$fication as stable in page fault operations. For direct > IO writes, we can use it to determine if we need to flush metadata > or not once the data is on disk. Hi, I've gotten an inquiry from some engineers at Microsoft who would really like it if ext4 could use FUA writes when doing O_DSYNC writes, since this is soemthing that SQL Server uses. In the discussion for this patch series back in 2018[1], ext4 hadn't yet converted over to iomap for Direct I/O, and so adding this feature for ext4 wasn't really practical. [1] https://lore.kernel.org/all/20180319160650.mavedzwienzgwgqi@quack2.suse.cz/ Today, ext4 does use iomap for DIO, but an experiment seems to indicate that something hasn't been wired up to enable FUA for O_DSYNC writes. I've looked at fs/iomap/direct-io.c and it wasn't immediately obvious what I need to add to enable this feature. I was wondering if you could me some quick hints about what and where I should be looking? Many thanks! - Ted