Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1183990lqm; Thu, 2 May 2024 07:33:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGM+zVw/GWErOFk2gZQ/6UDMMlO0xrf7fBNWGA/gvffDa2juuTW9P2tPLLRqsGSi6GMtYkh1WusGNhn4ttNB5zZtK1o1O2vwY6faK8ow== X-Google-Smtp-Source: AGHT+IFoOA9FkzdTwF9n6pgm+2C2+ettJfj6rVfNg7JtVNjdj/EevB4eV6bv3+WG4O+ixqDMieZl X-Received: by 2002:a17:906:f58e:b0:a59:21d9:df3a with SMTP id cm14-20020a170906f58e00b00a5921d9df3amr2817529ejd.5.1714660421414; Thu, 02 May 2024 07:33:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714660421; cv=pass; d=google.com; s=arc-20160816; b=FJtyM2h8MMI4oxWGTzopMBaeIAl1UH8S8CLXeKyRmlPnChTmICblrlCtEUNAWg9HaJ usmkMDhPES1plK72pxrqAJGsHJ1Z+T0A4mdIe+Wki7tmvRywwjUN1SHlvhYbly4u0MpA x/1P+n9g9wkgfTOUUG74vjYVNG/LET3HLlfQ4xP4xJomzanPTj6E1dQKlXVaFT3FxSDD PMQMj1ztDjdttIxz3x8VP4Vi0t0PX2NJxLtln11Gb3lPQxde8a+RSfP08n2UyItnMY3E Xfg9ZsNnL7CpuVDbaAyZspFFeW/yub02CCiU1e+gXJskZghBd3sk11xh6Tdcl4/v7T8Q xTgw== ARC-Message-Signature: i=2; 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=Kij5ehD2pOFF+dpfPbWxugpiUwQg7gagqqn0PAQuqNc=; fh=wOlxMURiY0PGpGEFsRunv/JWITMCXgddGPHIT6+sIlY=; b=Kd1ks5UCw+dhEwR5fRyNPFSyzZFD1K5or6uvSEv2WTVawAswGbvbqpnyIulDx45YSc cGrFV1Lm9KT31QZ6WgM4qMNrIjb4Boo9B1y4kcJTLaTDeJEOti5+ris/cs4hI86ItXN2 i8PZsZF0bac3ZGOfx415/II8EiKQmgkYUyYmRd87y8pN77E//oMuNg0uXJyrMDKYIFaZ lUOCN9AOGCF7ym2Q3PBdKqVk33gZL9spXENGwY8+xD/iEhMnai8K9p6xZYuXDgByrG+W /PQdzxVHFOYBiyTg3rX8WJmJ9nuA5qrrrITGhXjpfKJajq6SvB4YNKWcLTuECU3DVKWk zTmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WXQsmmDe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a29-20020a50c31d000000b00572a1eb650dsi573544edb.47.2024.05.02.07.33.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 07:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2262-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=@kernel.org header.s=k20201202 header.b=WXQsmmDe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 264211F21867 for ; Thu, 2 May 2024 14:33:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABEBA15350D; Thu, 2 May 2024 14:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WXQsmmDe" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2655B37147; Thu, 2 May 2024 14:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714660411; cv=none; b=uRDkDqPjTx3Yj7YFT1V74Eep6f9pZN8cte+PEzkXYRK3c1w1TTWovf2BpqDvrAMffbtfA25f8sJwz81kYspQkamvxqeKq6x0GRfNWRUfQgHs+LYMUk8MmcMqlqj7YNiWa5z6H2u62ncRYukmIwa+Cv0C8ULHMMnfz5W8aXLmmJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714660411; c=relaxed/simple; bh=xQdO77CyoJxmK3jhS4es9lNj/n0gLTY4Eehz3lTtN3Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dbS+SqVXPupYixcor0qZ0XnPLfLpSRVHaG3xGh2+ARbhNllZZOY5anN69iaYd4w7JYs3PSaPJUvTs2x05xjVddYKGgfCQdPXLIAk6gy5vI+VMPDALq625toDSC6+N5PbpVp1fw/XbwNFOFAz93RQB0BRRfUP8t0c4VHTIhq9Vak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WXQsmmDe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B05F7C113CC; Thu, 2 May 2024 14:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714660410; bh=xQdO77CyoJxmK3jhS4es9lNj/n0gLTY4Eehz3lTtN3Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WXQsmmDeSTzKE3rGnkHOoM5sZK3O37w1lpH6NDzi+rx6ko9CX6VJF4BunjxFSE3W/ IfzOrb/ngK9vNtwXm569S5fDIXmVZUNLuNiyMDeqSSf5HekHGrsIfDpvx4SGVg6hZ9 9XTQ8d0xJqlbKhF+pvhfvNHi4nSYRJpPnxU/y9VieHr2zQR76KuA0xTM3pb3Y2Zp6z xZ1uFI6bAezUPi7HfRvc/LvfigmmMLGWdg4dL25E4SkY+eO5Lfw3uB9XSqZY4pLIpB Z7CgkB9gJQeNgRTqrNLiXPwegwrZ5uM8MJMz/76w9cFqTF/3huB+RSpo8DtYyt0+NZ CYfmWkMOs/NeA== Date: Thu, 2 May 2024 07:33:30 -0700 From: "Darrick J. Wong" To: Theodore Ts'o Cc: Christoph Hellwig , Jeremy Bongio , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, Jeremy Bongio Subject: Re: [RFC PATCH 1/1] Remove buffered failover for ext4 and block fops direct writes. Message-ID: <20240502143330.GA360891@frogsfrogsfrogs> References: <20240501231533.3128797-1-bongiojp@gmail.com> <20240501231533.3128797-2-bongiojp@gmail.com> <20240502140139.GE1743554@mit.edu> 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: <20240502140139.GE1743554@mit.edu> On Thu, May 02, 2024 at 10:01:39AM -0400, Theodore Ts'o wrote: > On Wed, May 01, 2024 at 10:45:06PM -0700, Christoph Hellwig wrote: > > > > Please don't combine ext4 and block changes in a single patch. Please > > also explain why you want to change things. > > > > AFAIK this is simply the historic behavior of the old direct I/O code > > that's been around forever. I think the XFS semantics make a lot more > > sense, but people might rely on this one way or another. > > I agree that the ext4 and block I/O change should be split into two > separate patches. > > As for the rest, we discussed this at the weekly ext4 conference call > last week and at the, I had indicated that this was indeed the > historical Direct I/O behavior. Darrick mentioned that XFS is only > falling back to buffered I/O in one circumstances, which is when there > is direct I/O to a file which is reflinked, which since the fsblock unaligned directio writes to a reflinked file, specifically. > application wouldn't know that this might be the case, falling back to > buffered I/O was the best of not-so-great alternatives. > > It might be a good idea if we could agree on a unfied set of standard > semantics for Direct I/O, including what should happen if there is an > I/O error in the middle of a DIO request; should the kernel return a > short write? Given the attitude of "if you use directio you're supposed to know what you're doing", I think it's fine to return a short write. > Should it silently fallback to buffered I/O? Given that > XFS has had a fairly strict "never fall back to buffered" practice, > and there haven't been users screaming bloody murder, perhaps it is > time that we can leave the old historical Direct I/O semantics behind, > and we should just be more strict. The other thing I've heard, mostly from willy is that directio could be done through the pagecache when it is already caching the data. I've also heard about other operating systems where the mode could bleed through to other fds (er...). > Ext4 can make a decision about what to do on its own, but if we want > to unify behavior across all file systems and all of the direct I/O > implications in the kernels, then this is a discussion that would need > to take place on linux-fsdevel, linux-block, and/or LSF/MM. > > With that context, what are folks' thiking about the proposal that we > unify Linux's Direct I/O semantics? I think it would be good if it > was (a) clearly documented, and (b) not be surprising for userspace > application which they switch beteween file systems, or between a file > system and a raw block device. (Which for certain enterprise > database, is mostly only use for benchmarketing, on the back cover of > Business Week, but sometimes there might be users who decide to > squeeze that last 1% of performance by going to a raw block device, > and it might be nice if they see the same behaviour when they make > that change.) Possibly a good idea but how much of LSFMM do we want to spend relitigating old {,non-}decisions? ;) --D > Cheers, > > - Ted >