Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2131879rwl; Sun, 26 Mar 2023 16:41:13 -0700 (PDT) X-Google-Smtp-Source: AKy350Z38g01mlV8z5YbcAm+LhSF6d7XaqvnBf/3mdtGE4/yv7k5vHxylio08A9bKrPEh+v2FytI X-Received: by 2002:a17:906:3149:b0:884:930:b017 with SMTP id e9-20020a170906314900b008840930b017mr10037152eje.60.1679874073336; Sun, 26 Mar 2023 16:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679874073; cv=none; d=google.com; s=arc-20160816; b=PcVwXB/9c6s6KxtJTjM9zvEQNPih4NtWTV6qjSVbhT1VVksMmoXO+DfEEqEgHOzfds Um14idrp38wLdC29K9Fn2Xh5vKZFjfSzNtn21RCTZCSHdyeprTgvMPsE9WALIbTclN6s IC9axM87OI/Kb9o1dQyfaKe4673uLtNlm0c8c/bcUPBwZOs8mocge1oRJqx1RjiEUGkJ Ym7C3ON5pyluJJSHARJ/Abf5zexc2Uh4Ov0HmTokJjWSfQIz+qcWD7Nz0Ya9G/O/Te9k Z10tTPcO/zQMLDgi5/LgzcEbg9Y3W2ZKurQNyca8vDfWnxR8zHgjArmU7IFuxxdnJ/A+ tnwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GxavDADegA8D8D4cqFi6Pgh//L0JzHyL/uT8PMbCBW8=; b=pxewOwFsnGL17b9M5kHfe5IyNv9Lv53qI9HGHqJBueBD9Rt1FqIhcEiq28nCDIbfJq Xhq16SDFRdj1vK3HnUxo1cV4F0AzNzz7gnpECmTBaOddic1Dh7Z9J6rQuIWVwJAjQC/o sOTxmyrDTfqxP4XZYaqzFQJYwWux9uupmIj+2CMHmp26xw+5T1AjkaLJujYajnnzcMSK srPtNAuqJ3YVTjU7ZayfI7v+GKX2ysw5mtjCYk6w9rV4wCsi2a/0JMQp34ns8sCpg5XX V+lYxbbSGYWHmeQbroJFDjeSeit6rgmLeXc2SQkVSyVE/dSb2tOu02rMPEEbsziV7ye4 ObPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=PhrOnzbW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a170906048a00b0092fd7bea542si24025640eja.862.2023.03.26.16.40.49; Sun, 26 Mar 2023 16:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=PhrOnzbW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbjCZXj4 (ORCPT + 99 others); Sun, 26 Mar 2023 19:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjCZXjz (ORCPT ); Sun, 26 Mar 2023 19:39:55 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0855248 for ; Sun, 26 Mar 2023 16:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GxavDADegA8D8D4cqFi6Pgh//L0JzHyL/uT8PMbCBW8=; b=PhrOnzbWxGpMu8JvonvDeAb52v tin7Vc7DTDlvxZUpODoB9x0UZ9kVpLNDJZxqHtC3NN6wwD1rKh4dFQ36avx7iutUeBPLxKIgvq0wJ gJSacNhBMZPzchGlsL0r+Gu82WTjhpyOQCNsCEtUlpYhYF+Lkh5cniUQVkc+3vCQN5QPQa79qyhYh 9hUNuSrvMV5QbQo8hwffBbr/g8VnsOmFZYf+EfqU7wrRHEEw+ZHehpiMy+sJtS7zt9Cp/ru7n5IcS 7hKwaP0szC6vDPVETvv79rQTj+UX0ldUHdsqxRsU0Wa2xxIngDzNihqjVTsV1Pa+EmqMGg3+fcDLC uIVSDg3A==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pgZx8-009M33-1H; Sun, 26 Mar 2023 23:39:10 +0000 Date: Sun, 26 Mar 2023 16:39:10 -0700 From: "hch@infradead.org" To: Jaegeuk Kim Cc: Damien Le Moal , "chao@kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "hans@owltronix.com" , "hch@infradead.org" , Aravind Ramesh , Hans Holmberg , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH] f2fs: preserve direct write semantics when buffering is forced Message-ID: References: <20230220122004.26555-1-hans.holmberg@wdc.com> <402cc90ce5defa81c937c3fcd09de1f6497459ee.camel@wdc.com> <8207efb81cd1e9322ad608d313eb4b4bd5740e80.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 05:46:37PM -0700, Jaegeuk Kim wrote: > > Yes, and that was exactly my point: with LFS mode, O_DIRECT write > > should never overwrite anything. So I do not see why direct writes > > should be handled as buffered writes with zoned devices. Am I missing > > something here ? > > That's an easiest way to serialize block allocation and submit_bio when users > are calling buffered writes and direct writes in parallel. :) > I just felt that if we can manage both of them in direct write path along with > buffered write path, we may be able to avoid memcpy. Yes. Note that right now f2fs doesn't really support proper O_DIRECT for buffered I/O either, as non-overwrites require a feature similar to unwritten extents, or a split of the allocation phase and the record metdata phase. If we'd go for the second choice for f2fs, which is the more elegant thing to do, you'll get the zoned direct I/O write support almost for free.