Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp23517rwj; Fri, 28 Oct 2022 21:50:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM57C56oEtj5mMcdPTTnL3Fr+Dps7ihu7n9mc5/pAe1jNI2W7bVhuTSwnhHZ5JTf4JwGRpVq X-Received: by 2002:a17:907:25c5:b0:783:f5df:900e with SMTP id ae5-20020a17090725c500b00783f5df900emr2271437ejc.491.1667019059530; Fri, 28 Oct 2022 21:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667019059; cv=none; d=google.com; s=arc-20160816; b=hndXjZk+802H3jylk67ajSU2kH0rywMqGCxxTHoa4zU3EXZA91wUonl598Dz8qtIjc hcX/y971nm8q618D4JAJGG6lhPSTNdyvizdhlhW2ufR8iE37S5ryz1BHSwiKzW3cj7ET nRBq9ue98cBJcwK2l5V/t37pC/b9P6FA4O/2ukWbJ3PN0x0Xp/SfauXgx3KOxDGfmD61 J/pEeBJNQ30p06mDo/xTNwTUSVpfaByLW1rB09YkVzHM04UbBxwxFUbQHy4lc3mFR5tZ 3NAsWQO+PR/L9IOMdPAtBVc40f0p8WzbUHXtFU5/XZsfYFINF41KFgxCYZBAno1SfVWg zkIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KUOB99+eNFVZwcGV53fgw8ytEoA1O6w5bQdwqcMTdN8=; b=wLG7LAU9fWoq5z8ASgAC/YzbvNozJ7PDj4znTEh1trTCJdATcjxL2l018CGmAp4oJ3 RTZ+lHk6gvRBYJoG1srHCBx2HoPyLuObTU0Tf65lUfyrBhRDwmW1Y89UAWZJWahNKZeh apqXkyadDeuZ4fx7vOaVRa/s6QRhI2xUM+7jAeOsX8Ili9JNNkYMqQtYuHsBeKCjL/Mj WZqNu91QFBOUUV6hDTe/jI3IkDW6/l25ZDMPKqM1gjdjr5eHFTXjtOoKlpxqn7iqjuAX 65CKYD7L1SAjAJoA2mPSdW3mo+goiovq+89GQXrum7WJKvYzr5p4ZROzxUeKd8m1LgHV vWiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CYsWQpVB; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a1709066d0300b0078dcd30bc94si565952ejr.529.2022.10.28.21.50.36; Fri, 28 Oct 2022 21:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@kernel.org header.s=k20201202 header.b=CYsWQpVB; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiJ2Erh (ORCPT + 99 others); Sat, 29 Oct 2022 00:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJ2Erg (ORCPT ); Sat, 29 Oct 2022 00:47:36 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E7218B743; Fri, 28 Oct 2022 21:47:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D9447CE2FCE; Sat, 29 Oct 2022 04:47:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA46BC433C1; Sat, 29 Oct 2022 04:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667018852; bh=mAACII8QLXPb+2oghNArcGBgEFrS6aOgUSNOHVDZKPc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CYsWQpVBnAqxfH9QjR9cAu5rm4qWCaoDoHDMrXu8qeGJPjfInBlhlb4hosNwuCb5y 2/JzqwR6JP/mLfD9pMpYktbhYQ40F+5gyKrX5+LhkAeZVCGACQWLfAJN1MO+F+rPcr pF8cd+2VZwfLQNvSAvq7XUTQh6KwHuX3FKB2+f+TAi2/+GyiiYYojDCj8PoUYR+ZFY DOI0yXq6r/4zM8H+euAL9EjltJmkjxHL7PzH4n9I24I4nBVjmUa8zpgWtf5jD8qY3B fNuxhK1UeMdSTzH7u3Edo7OiEPYEp8TUmTzUuPUUxaMVZZr+PpvXV+EUQRERLh+cl5 knBFlU8Gx7F1w== Message-ID: <80fe1f37-586b-4fc6-f007-1d3e8ec3fdb9@kernel.org> Date: Sat, 29 Oct 2022 12:47:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [f2fs-dev] [PATCH v3 13/23] f2fs: Convert f2fs_sync_node_pages() to use filemap_get_folios_tag() Content-Language: en-US To: "Vishal Moola (Oracle)" , linux-fsdevel@vger.kernel.org Cc: linux-cifs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org References: <20221017202451.4951-1-vishal.moola@gmail.com> <20221017202451.4951-14-vishal.moola@gmail.com> From: Chao Yu In-Reply-To: <20221017202451.4951-14-vishal.moola@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-ext4@vger.kernel.org On 2022/10/18 4:24, Vishal Moola (Oracle) wrote: > Convert function to use a folio_batch instead of pagevec. This is in > preparation for the removal of find_get_pages_range_tag(). > > Signed-off-by: Vishal Moola (Oracle) Acked-by: Chao Yu Thanks, > --- > fs/f2fs/node.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index a2f477cc48c7..38f32b4d61dc 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -1935,23 +1935,24 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi, > bool do_balance, enum iostat_type io_type) > { > pgoff_t index; > - struct pagevec pvec; > + struct folio_batch fbatch; > int step = 0; > int nwritten = 0; > int ret = 0; > - int nr_pages, done = 0; > + int nr_folios, done = 0; > > - pagevec_init(&pvec); > + folio_batch_init(&fbatch); > > next_step: > index = 0; > > - while (!done && (nr_pages = pagevec_lookup_tag(&pvec, > - NODE_MAPPING(sbi), &index, PAGECACHE_TAG_DIRTY))) { > + while (!done && (nr_folios = filemap_get_folios_tag(NODE_MAPPING(sbi), > + &index, (pgoff_t)-1, PAGECACHE_TAG_DIRTY, > + &fbatch))) { > int i; > > - for (i = 0; i < nr_pages; i++) { > - struct page *page = pvec.pages[i]; > + for (i = 0; i < nr_folios; i++) { > + struct page *page = &fbatch.folios[i]->page; > bool submitted = false; > > /* give a priority to WB_SYNC threads */ > @@ -2026,7 +2027,7 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi, > if (--wbc->nr_to_write == 0) > break; > } > - pagevec_release(&pvec); > + folio_batch_release(&fbatch); > cond_resched(); > > if (wbc->nr_to_write == 0) {