Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp134516lqf; Fri, 26 Apr 2024 01:50:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkLTb4eUkqQAHFPhAGWeepOsh5ZdUFKCBo1nTWVn4rvyzpCzTI327jQSlllKDpbK3dcYG6xHCw7gzsTBpgnZXvi/UxF+Ix0OqqfD7/vA== X-Google-Smtp-Source: AGHT+IE6He99z9XP08Tk835jgdOBHHZ+mEknh/IxdpdD1As3+ruqcvSHU9/RG/nFNzFmxMax1U1G X-Received: by 2002:a17:902:ecd1:b0:1e4:4ade:f504 with SMTP id a17-20020a170902ecd100b001e44adef504mr2278938plh.46.1714121433157; Fri, 26 Apr 2024 01:50:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714121433; cv=pass; d=google.com; s=arc-20160816; b=KOkAzEGU1SFcTwoo519XLrTLlEgPSqAjUlyWcHs707YtJjnojc3Y5Dj+RN96c3ZpN1 lHxtMCc76C8YtPD6SSuSsdp5JwyrDDd9sAkMjPVfidZ2C6gRtx6twLwf8WAJ3xi9kiI3 T6ANQxIf/sWNzIEQBu7AZDWlLCh1LSGD9isipzME//j8bGxH+/GnH8OfFJSBOd3I4diC 0mkE+Xo9v/VjLw1a/crrZNuykLn3a4jNUW7NtWIoGUNQsgH366vDd4u7zzpBrKu0a2Rd nTCJZEorNBEpL9tF6OZgnMNTBayNJrqKTWL6cxFLnjEQp57WrbZJeYbN7CfSJNl52Fpz 0EDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=cJFMMSFWa30LVDJuI+U3h4eLS4EveVUZvpWPDq6Pib4=; fh=or6W5rB4jvqQXEd0EKfnVucDe67QXmuc7J45XpwgMjs=; b=huMYm1fRnXs8XEwDBu4W9Fsl3a3qIyME0XllYzRgUTG6Qqk9iN5EtpyCsGakEXj8Gn QEoT8J0SMPh+Bzk07WT6iWOPk1sQmNO2Of+faRRKgaeE+qqc89tewMSNxof4wlVPvb8j imCe56vtHyJAd3O3Ux3jDdkw0BqaSDzr8vr7KRgP0KY8okspXj3ZRg2fKay62kZlRlB2 dWke+Hn2Z80uZi2/pV7Np/8oKXP+UxkNNHd7joAcyPDYcqZtvFeki9+UvWaIliRYmVHA 0P8IJKn6A8gosuPJsfvXxvQrPxy1vQ37vkCLy7YmICNiAaVvYiceIDco+NJjyRawiRua 0Wcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A3J/Wyo2"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-2195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w18-20020a170902e89200b001e788371561si14866725plg.524.2024.04.26.01.50.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 01:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="A3J/Wyo2"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-2195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A4CD3B2109B for ; Fri, 26 Apr 2024 08:50:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44AE113C9CD; Fri, 26 Apr 2024 08:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A3J/Wyo2" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FB3C14293; Fri, 26 Apr 2024 08:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714121419; cv=none; b=T5sNx7KANcQIUF+mq44NVFnO+KYAq/OH2Iiy2V/cQLjo/3Q20np6OSAcpwCPv9aXsVflqnUVR/mX+0zIwjHH4qt/CEgFbvs9l1xCuhr0deBdtSFpKiitIxN74OvnENVL52W5oL0blju649wTAfyx4LfwbR7DK1WpgXqEaVIhWGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714121419; c=relaxed/simple; bh=DYNyroIVKSZ0unmnVFHuxmgLOubVibFZ/fyc8X1R8f8=; h=Date:Message-Id:From:To:Cc:Subject:In-Reply-To; b=nBa8HN9FbuPH+pPbwAoTyRtOF7qih+nxh3tI3aDESwJ5pvD1uaQjDXTOcpW8iS1xCEfSjKTnaWzVm00GDAnD7PKbaTk1xAnUhWHDhbEo1u4KYs9I5Yc+7TKHAIYwo3PtD44gpuLmZanDC/4sBECZFkjxTTaHjlXNmIMh0LjybSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A3J/Wyo2; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-60c49bdbcd3so517982a12.0; Fri, 26 Apr 2024 01:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714121418; x=1714726218; darn=vger.kernel.org; h=in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=cJFMMSFWa30LVDJuI+U3h4eLS4EveVUZvpWPDq6Pib4=; b=A3J/Wyo2xwjgOMWyBdMtUfVWXPYA6+GmPoGaMsicZkZffLBVmdokLub+mMMKE/eF7Z 8rfnpUYxIbaJaLsKmVaNngPrELRs2EhS1EVNV4m7ZsCiBKmmFqAvlWfICkwdZQD06ipY 9KK7PQAixruu6ApvyGCBs66B+G37h4ANd/cdBELHQo8d4gib0QZTkNoeSS4sVwzDk6cv EgfS/aVINe5gn0d2p79KJbMdvngXiJqVZ7NbP4jOvVlxw6MD0CJ4Mrqh0ZVF0duiRP9N 3IvQlDbyWg7CnkDTDKXrYIG9MiwhMhRBEeu5+sN9TGrYyK4YSMcG3J8jvWKTYrD9vTgp YX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714121418; x=1714726218; h=in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cJFMMSFWa30LVDJuI+U3h4eLS4EveVUZvpWPDq6Pib4=; b=qXOzJbOUsx67hxYg2d3uWE2Z+4xeh5ZPZYYHy6zftA8aJpiVbWDwjqnNXKmTUiI4RK /MvxQM46MTavg/OWGr4R1quE2/rSYtFNyb0+Iwkc16p5rJkPOX3+yhSZ5Faj3orpuHeu hcNocAIUjQ8FshVJbEM9JSSC9L51baTqMXRrYsoUDbuPKGDBmyPuxpmHxINm5JCo4Kiv 9ik5twUDJWxzHQDuvdu5YxFSh3KvyUPtrTOlvQI4ZPWyxESUfkjnnkAF15u8BLCL40AG 0j+B6boz5AKHDUGkqDuiI+FPM2TP92NYCmbJp2E5H8BhUXKQfRKqr33ZJKYpP4KwdUVM M+Dw== X-Forwarded-Encrypted: i=1; AJvYcCUxvkGf9EnQNtaQZenyKfn+3cwx5Voiy7oPudqQ5UNQvM4ZYAKRVgKkzcpTSiVSlu6Df4fbA03N86e99SJG47CV80goc4VObOay3NEsf9C49Yx0vWuP939U10ubBvGtwHUzw8HWHeyIOA== X-Gm-Message-State: AOJu0YyiBJ7TAsxdhZOdinnA8JDQ0F9Cg5ytRk1PsErymro9uIpNP6Dr Y/zSnNUoUba2ScELgOFG/jvjSvPdbf6xrHj2M4GYKb57PZji6GTs X-Received: by 2002:a05:6a20:daa7:b0:1ad:7e4d:6dae with SMTP id iy39-20020a056a20daa700b001ad7e4d6daemr2613505pzb.6.1714121417750; Fri, 26 Apr 2024 01:50:17 -0700 (PDT) Received: from dw-tp ([171.76.87.172]) by smtp.gmail.com with ESMTPSA id 192-20020a6301c9000000b0060795a08227sm3694145pgb.37.2024.04.26.01.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 01:50:17 -0700 (PDT) Date: Fri, 26 Apr 2024 14:20:05 +0530 Message-Id: <87wmokik3m.fsf@gmail.com> From: Ritesh Harjani (IBM) To: Christoph Hellwig Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , "Darrick J . Wong" , Ojaswin Mujoo , Jan Kara Subject: Re: [RFCv3 6/7] iomap: Optimize iomap_read_folio In-Reply-To: Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Christoph Hellwig writes: > On Thu, Apr 25, 2024 at 06:58:50PM +0530, Ritesh Harjani (IBM) wrote: >> iomap_readpage_iter() handles "uptodate blocks" and "not uptodate blocks" >> within a folio separately. This makes iomap_read_folio() to call into >> ->iomap_begin() to request for extent mapping even though it might already >> have an extent which is not fully processed. >> >> This happens when we either have a large folio or with bs < ps. In these >> cases we can have sub blocks which can be uptodate (say for e.g. due to >> previous writes). With iomap_read_folio_iter(), this is handled more >> efficiently by not calling ->iomap_begin() call until all the sub blocks >> with the current folio are processed. > > Maybe throw in a sentence here that this copies what > iomap_readahead_iter already does? Does this sound any better? iomap_read_folio_iter() handles multiple sub blocks within a given folio but it's implementation logic is similar to how iomap_readahead_iter() handles multiple folios within a single mapped extent. Both of them iterate over a given range of folio/mapped extent and call iomap_readpage_iter() for reading. > > Otherwise this looks good to me modulo the offset comment from willy. Yes, I will address willy's comment too. Thanks for the review! -ritesh