Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1908633lqm; Fri, 3 May 2024 09:42:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXe60LJMI6sjsfOSPwHXCEp15JEYm9CUq7lb9NWCiRLk/2q4LvXxDiqyS5yDFl6MclNb3nXSsZm7ZGogGXtcXWcnfha4vGOAf5Npu8+2A== X-Google-Smtp-Source: AGHT+IF/LbWxaT+urvYPTL/XRNEeTZis+5iT1FtaOpsHdhi6A+LtJlcJlgh7l71bPZRV9NknylTd X-Received: by 2002:ad4:5c68:0:b0:6a0:5ad6:54f4 with SMTP id i8-20020ad45c68000000b006a05ad654f4mr3870154qvh.33.1714754523917; Fri, 03 May 2024 09:42:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714754523; cv=pass; d=google.com; s=arc-20160816; b=V69KiwwqPxtykcYa1VQsKInzBiswrO1C0mASEkCOsSYy6rElfpb+Q1w+YKuCVQpCuw gOYFi/HsEMJeo0DYHwWOIRm2d/E00TZIDdKBurFVmX//v52U/4t/DP48DQgb0bI0kvDx 1mTTf6mI1sJ+KYEGIBMr5ql5nvhU21IQUDVGHPlPN72FLKg2BrAO1axPFa9fbx/T1ovQ iRi8Hesbo5YTUDltg8WLlS8jGnman2hbfOiLPQVZWwzxXDiFJGCLFYf3JpIR9xBNnAUt 9ZSk1ya0BB9GykM5iRV5mJBWUd8P0ogUx6Ubd+bSE/a2M8ZPcV2P4RbqdbL7w7b/vAhy DRCQ== 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=+Z84RAYfT/9xy4ioE2Mpx1ruRenvb0RbYAc0UnSuXus=; fh=B5ToUkd0k3nvgYe7RC2bSwnWvLpRWnuP+T2S/w9/q/o=; b=dtKDk+cCG6BuyEoQpXKFSnRnLVRX38j5Bnhuir46sS9NS7xjhVPy5296nMYC2Zv7Bd NqaB9W61wGr19konIy2EpX4OBKRRkc5kLXVbYcHas3vEQ+xJfkZ7onYwZtZcEAZosXgF I6QjhbBdO0DbBWJx9fWYORIMfpvMhGEq2vrd/YR3gxIpmpm4hE+Eus8WEjAO7llBqsD9 Mnd27vBZuuceEJIQCsJmAi7Ai/nEeS+dOUKROF2H62pFq0hQjNMFVFj6cigMRlgUpDuz +DzwCsyOE232GLssnmW34MXgtoxVE4czgAX50i4cT1LIMj7+lBvq0+JlJKtNxmNm8ACy jTGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F3uGIcy9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-2288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2288-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o6-20020a0562140e4600b0069b55db0afdsi3402858qvc.442.2024.05.03.09.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 09:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F3uGIcy9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-ext4+bounces-2288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2288-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 3FD9C1C209F4 for ; Fri, 3 May 2024 16:41:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C25615698D; Fri, 3 May 2024 16:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="F3uGIcy9" X-Original-To: linux-ext4@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 00EA315689E; Fri, 3 May 2024 16:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714754489; cv=none; b=E7hS9FRvGQxb1K8eulQEeCyLAeVdcvyWYKNVWjXWcE/4n/SbsYSsuZQ5Adrg4mvX1Vn5Zg6MS5dPlf4a4BvGWrKM76TTa16tKbrr8QMXUIJeF06bpLE5TMxOGGPhoXzEebwKkcDORib0gb4NrY6Kor5EiCAaSOr6lbCwqbBuvZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714754489; c=relaxed/simple; bh=B1UyLJUxHu3/4rhG+wBsUK5RxLqKqYVkH//ea/Z4r44=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rNXLc77WqBGnpdrVilFr1WcyN+zX0kUBdlfqgHpYKMA1qkpVTniQnio64fVzwZj6UQpM73K35nN70XfALcIhBy4PEIEQO+co80FHzbwqwJZikwxfmbjtAeCqzuFlupbGAdDuL3xQjsXGWd54kjpznN0zOsTQzVqXxDrqg18Dt5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=F3uGIcy9; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org 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=+Z84RAYfT/9xy4ioE2Mpx1ruRenvb0RbYAc0UnSuXus=; b=F3uGIcy9H02yNI7SSNmjpHrNiE RznrjD0Nmccq62dP30bCl3YqZcz6AcRpgzMyGq2uTQtXbbDmkxe+h4UVIOf2Aw9HsnkWbW+GTryUm rMb6A4gHnDlc0gHg7HBjff6s2FIJ/PTp/TBdALy0yYVak7H1r2UwfruPZqVIRggS4jqj6NhnMGYab U9Kg/r8maUxO7GYdZ2XgNhZFS7A1uK9qLhKLMdODkC4q73v7q4iOsjtU5Tbpe2TTYx84RUm/lsLiO J0dJX3DmY9rQNdgpSGydrcffe3mU4lvE+bNDRL9zsAP6Mrdh4M75+8T2LAAs8F2Y18m0zXucLV6Ej jgGCEoGQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2vyQ-0000000HG7f-0r1s; Fri, 03 May 2024 16:41:26 +0000 Date: Fri, 3 May 2024 09:41:26 -0700 From: Christoph Hellwig To: "Ritesh Harjani (IBM)" Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dave Chinner , Matthew Wilcox , Christoph Hellwig , "Darrick J . Wong" , Christian Brauner , Ojaswin Mujoo , Jan Kara Subject: Re: [RFC] Documentation: Add initial iomap document Message-ID: References: <17e84cbae600898269e9ad35046ce6dc929036ae.1714744795.git.ritesh.list@gmail.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: <17e84cbae600898269e9ad35046ce6dc929036ae.1714744795.git.ritesh.list@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html > +i.e. at a high level how iomap does write iter is [1]:: > + user IO > + loop for file IO range > + loop for each mapped extent > + if (buffered) { > + loop for each page/folio { > + instantiate page cache > + copy data to/from page cache > + update page cache state > + } > + } else { /* direct IO */ > + loop for each bio { > + pack user pages into bio > + submit bio > + } > + } > + } > + } This would probably be easier to follow (and match the actual code) with two separate flows for buffered vs direct I/O. The loop for each bio in direct I/O is also not wrong, but maybe a bit confusing as we really map over a pinned memory range. The code just has a little optimization to directly place that into a bio. > +Guideline for filesystem conversion to iomap > +============================================= Maybe split this into a separate file?