From patchwork Mon Oct 17 20:24:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13009460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5FDFC43217 for ; Mon, 17 Oct 2022 20:25:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1DA086B008C; Mon, 17 Oct 2022 16:25:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 166B86B0092; Mon, 17 Oct 2022 16:25:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E84236B0093; Mon, 17 Oct 2022 16:25:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CD3F16B008C for ; Mon, 17 Oct 2022 16:25:08 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AA67D160DF4 for ; Mon, 17 Oct 2022 20:25:08 +0000 (UTC) X-FDA: 80031570696.03.070DA83 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by imf06.hostedemail.com (Postfix) with ESMTP id 38683180036 for ; Mon, 17 Oct 2022 20:25:08 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso142082pjq.1 for ; Mon, 17 Oct 2022 13:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VPyaEfnfsN/s28KIqk5JK9av//7f4plsWX6QMWBWYvw=; b=AAaBUf6AYZwl2VDHcCjIUHoo+BDNMPnV+R8K7xw03ITt3bJu/PXwBptMp+Cd78GqHp N1fPmeaEcgT0dNOi5heH8RkIvQzLgdDjFTLLFkJTMuZtMzDzhqm3A5e2TUW+009WVhvP LnQ+Qnxue4GNQ/W4GSqfITdI/xtl/FcZVOsSAxzDrhPsnLCBNI0Pam1Vx851IlCokycW 3ihi+TyICcYVO2geBMteJjeyBoyopJkqhfYcH/Zh5WCo+KIFfIyQ0WkYt52MgC2bUa65 R8/gksQ//p7O7voqbBaQcC5j/XMc08BKModktLu/0bF2tT6gRFEgGcvAeXRPf7IXx8T9 8+gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VPyaEfnfsN/s28KIqk5JK9av//7f4plsWX6QMWBWYvw=; b=EONbr9tbT6oke9slpTXocS1sqwbRllVS6UNcPgk32H8Os1lryIVBCMAhhIkehzuUYU a5qesasZ8nZUH/O9FdNA0+3/HvKSyN2cEMMUX5eUOub5dzj41ycelv4Tdk5d7St8h9d/ DrjtBPWUQsID8Jxy2W4fEkteXW2C+/BdFmdsoTRADCShFTqswX5rGM6hhlP+RrkkxWTM qmdH7Qu5wFOOBVRHkPyiWGgLUUHfu+Z62EAF7bWaKMr0gxhIMOjGsrMpt2tUKLOagnvY M52jsNiqqWT38flgPJp2mo19h69BdRJDlqTaOZh9OX3lBV9CjeNgWK1oWVp3IYA5vmDV 0/Rw== X-Gm-Message-State: ACrzQf115/566Mkv9mnL5EZn5lJ7Fg/QKrNq/UlG1ZX0VLEeaVogRQI/ ApNWDFw5dm7/kkM0Xr74vz8= X-Google-Smtp-Source: AMsMyM7v1A0Nwi1EfmmDwlAxUHQ5Y+/Mfh5CmuQv94z7lhNxS6TEescrW3W2GC19QPdRPdkxp8Fsag== X-Received: by 2002:a17:90a:4216:b0:20d:2891:157 with SMTP id o22-20020a17090a421600b0020d28910157mr35557408pjg.47.1666038307198; Mon, 17 Oct 2022 13:25:07 -0700 (PDT) Received: from vmfolio.. (c-76-102-73-225.hsd1.ca.comcast.net. [76.102.73.225]) by smtp.googlemail.com with ESMTPSA id pj12-20020a17090b4f4c00b00200b12f2bf5sm145037pjb.1.2022.10.17.13.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 13:25:06 -0700 (PDT) From: "Vishal Moola (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nilfs@vger.kernel.org, linux-mm@kvack.org, "Vishal Moola (Oracle)" Subject: [PATCH v3 13/23] f2fs: Convert f2fs_sync_node_pages() to use filemap_get_folios_tag() Date: Mon, 17 Oct 2022 13:24:41 -0700 Message-Id: <20221017202451.4951-14-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221017202451.4951-1-vishal.moola@gmail.com> References: <20221017202451.4951-1-vishal.moola@gmail.com> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AAaBUf6A; spf=pass (imf06.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666038308; a=rsa-sha256; cv=none; b=G0yh4MtE2Lt48ZAj6aniANwJeX9ikrYB4hUw8JfC/MEq6yBS2EtA9Y7vxhMzug2Y7SRlVA tVWmIilpEIFiDTFoA7L+aSJgbcV3WKlqq1Mzs1y7Dd0ii39QPpEcC8FHruhiDSw2rcfhML 2dcKgrImwchgj7f9JBvS2z+FGGe2u4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666038308; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VPyaEfnfsN/s28KIqk5JK9av//7f4plsWX6QMWBWYvw=; b=M7nc3mTq8CNngBm5AoXk6XFP3XaL46iiZjIw42AcfPy4EBwUIAet6q0B40CNSTBez5kwGL ZGW0iMtb/KUgVcGpaZ+aY8FPptKm8LA47rTuaPTB92oeDB0+RpLRLWgWcrB4to/+qNlQmj 6g6KyisIKIpqwnidL3ROGm4u7JGZ6AA= X-Stat-Signature: nzoeqciqr5b65k3o4c1w3bfqrx71uoej X-Rspamd-Queue-Id: 38683180036 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AAaBUf6A; spf=pass (imf06.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666038308-29411 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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) {