Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp63935rdb; Wed, 29 Nov 2023 20:30:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkod+nhvlU3qWsCVUVMXmbw3sU8qCrtTeqgew0apaxEgOpZTyFLi6XZ5i6xI/+i2yCCa+v X-Received: by 2002:ac8:5f83:0:b0:423:723e:e5da with SMTP id j3-20020ac85f83000000b00423723ee5damr22592208qta.39.1701318618135; Wed, 29 Nov 2023 20:30:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701318618; cv=none; d=google.com; s=arc-20160816; b=SOEDexg/2ocOahD0w0iQ8ehgOKKfsbamrJTaK/x3viw/rcs8PYiWl20FVjHxOnyxLc hjSE8TnYRAmosvQoJqfPptTH5IMJg/0ziCk3k5GW6v4HJkY2BUfcGxC/0mgQ8ykKz+ny vqZHaFZW4aLNGiukygHbpUaWTl3vQ+X+Y0Py7AwtpTJrc0a9Z7cKwo81BuOq9Hh1qBTK X62ymcGxvjYKRaypNYBmTvjmRk1I1Pn3Hmq2cxrPimikyfE9QSy9c9E55lBgs9Z490I9 +ayqcblxxQufLvLPIcLPMzXPRqGafyJSWFpB/LQESJ6498J1ZvAkzKgYd5Yr68/Q17r4 xnVw== 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=R/BiU9GWKs+bhwEOjW3vWL3keOlVXNoi9F0ioV7m9Wg=; fh=V27LbAvSmQJYIXm5tSWviLTBmLElXzk2J/hfFga/8SY=; b=tn4TLG4yfRYHepp8UqbT1IVJ2jCqbRKNhQCsKu2Ekny7zMcT+4ObH+S4aSJIGHM/DF AmPMW1tStzlRZvg50Lhx4Q4sglEs5LIlGtjiePYeMOC6J/LSPKYOR68Q78FBTAzqRTu4 c/Vb+ILuuK1GNaEDFvKlZ4vE1M3x2Nf+MGYTrUuoy0OrtlyOfrpQRWgUOIL8XSexcDj2 Z3p8YbS+Jh4NRmtUkIM8L9gHWnzTdOTnREEk2O6Zpa1cbi5npbU1qclJnv5+hrxGKSQP V4R9QfODs//bg0k9lx5qwyrvNYREZ51q77chmHuSveLNdYNPsuzudZUxraVSST7kahjh djbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=e0mvhCUn; spf=pass (google.com: domain of linux-ext4+bounces-228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-228-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jx25-20020a05622a811900b00423e425e476si297376qtb.300.2023.11.29.20.30.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 20:30:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=e0mvhCUn; spf=pass (google.com: domain of linux-ext4+bounces-228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-228-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DE79D1C20AE3 for ; Thu, 30 Nov 2023 04:30:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 150301802D; Thu, 30 Nov 2023 04:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="e0mvhCUn" X-Original-To: linux-ext4@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD7E10D9; Wed, 29 Nov 2023 20:30:06 -0800 (PST) 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=R/BiU9GWKs+bhwEOjW3vWL3keOlVXNoi9F0ioV7m9Wg=; b=e0mvhCUn3b+hx7UrqkifA389t8 SfAgzn9y6yKpry58uZ+Ftu3ZSCQxAk6WpX36mk7PNKC/k75vR49aEsyRU2R/1ze3KnY55AR9IOVnK pDxpZotrh5T4x1nPbKNIIRlrc4HBG4M9puvbI3qHX7Ckm4gRxfSk94/FUZEw9gXU+siCsPn38UbXm 8/LvLp5+J3sjZ9wFaSUqLWOHM9nETZPzK7Ou6kWkqOf+5MSsNnDgULSyBCyoDAXdVDEVvWeNtP6eq uvHuADHXQlbowLhKiK8tosu1WFfFvM7VyS3f5o+2uW86lCxSA2rRLui6M/iLyNGu7O6USp3EDVoez m6vn6kQw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r8Ygf-009uOz-2W; Thu, 30 Nov 2023 04:30:05 +0000 Date: Wed, 29 Nov 2023 20:30:05 -0800 From: Christoph Hellwig To: Ritesh Harjani Cc: Christoph Hellwig , Jan Kara , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC 2/3] ext2: Convert ext2 regular file buffered I/O to use iomap Message-ID: References: <87msv5r0uq.fsf@doe.com> <8734wnj53k.fsf@doe.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: <8734wnj53k.fsf@doe.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Thu, Nov 30, 2023 at 08:54:31AM +0530, Ritesh Harjani wrote: > So I took a look at this. Here is what I think - > So this is useful of-course when we have a large folio. Because > otherwise it's just one block at a time for each folio. This is not a > problem once FS buffered-io handling code moves to iomap (because we > can then enable large folio support to it). Yes. > However, this would still require us to pass a folio to ->map_blocks > call to determine the size of the folio (which I am not saying can't be > done but just stating my observations here). XFS currently maps based on the underlyig reservation (delalloc extent) and not the actual map size. This works because on-disk extents are allocated as unwritten extents, and only the actual written part is the converted. But if you only want to allocate blocks for the part actually written you actually need to pass in the dirty range and not just use the whole folio. This would be the incremental patch to do that: http://git.infradead.org/users/hch/xfs.git/commitdiff/0007893015796ef2ba16bb8b98c4c9fb6e9e6752 But unless your block allocator is very cheap doing what XFS does is probably going to work much better. > ...ok so here is the PoC for seq counter check for ext2. Next let me > try to see if we can lift this up from the FS side to iomap - This looks good to me from a very superficial view. Dave is the expert on this, though.