From patchwork Wed Jan 4 21:14:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13088962 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 A25D8C46467 for ; Wed, 4 Jan 2023 21:15:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0464D8E0010; Wed, 4 Jan 2023 16:15:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F12F18E0001; Wed, 4 Jan 2023 16:15:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D645C8E0010; Wed, 4 Jan 2023 16:15:17 -0500 (EST) 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 C9C608E0001 for ; Wed, 4 Jan 2023 16:15:17 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 962B614079F for ; Wed, 4 Jan 2023 21:15:17 +0000 (UTC) X-FDA: 80318372274.06.9E94AE6 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf14.hostedemail.com (Postfix) with ESMTP id DD387100004 for ; Wed, 4 Jan 2023 21:15:15 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GGaN80QX; spf=pass (imf14.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672866915; 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=x25JE3Kc6tv/CRPnK8Jr5HLS2sX0SCmIF/DAVcH2FqE=; b=JPKTpfhUnQKQFI0oTeWARKT6YgxdDEzxrWdoDbSxmabrp3fMWXm4fruYBBdGPq9U0OpDye CN9Vh+WyZ4I4rcwoC1qByhCkvQxl5rrK+EdO3S4lfXtHIvBPwT2OAznaf6xCjybLdnq9In AVVVNyydw+k9T6hl+W8nxS4PbycFgX8= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GGaN80QX; spf=pass (imf14.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.47 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=1672866915; a=rsa-sha256; cv=none; b=I0afyXvvO1MLEw9DxLUwNK5rTGJN/mrto11FZUIIIKtkJO/27fHk6pcoIhpB7P1BTCDJoQ 8VPplHjd99Jv2ugc4LTra1N/zxPdYGR0J83FCrbqSpynZUW1qTY7dm8DwI3a9wY3xywwE6 O0DcRNYcS2wdIXcFY/oVVBsB/RK2278= Received: by mail-pj1-f47.google.com with SMTP id c8-20020a17090a4d0800b00225c3614161so33095280pjg.5 for ; Wed, 04 Jan 2023 13:15:15 -0800 (PST) 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=x25JE3Kc6tv/CRPnK8Jr5HLS2sX0SCmIF/DAVcH2FqE=; b=GGaN80QXsh4J1YXL+CzIWsFbPtYnvqnUAuR7BlWM5cg7Fb96IUWkf9YKtYSUX4xJiv fdrgdThz8UL3P4MZ+eHMu/4K966siuQI6iAdHR2MVQjMjV6MN1GRnO6doH2uk5OhpsZO LY78o+yIQS4ow8RQaNkPfGCKMNJtGI3xD9tlc5jEE555TQyh8J94/Gr9HVriMtas67IH FB8OUwFz1Oy3rJJOCQeEa/ZHyPHJEdTE5f3SEzIDvxTL2bZ5bnEYjE/0AQom1yTmJR+y hcZ12FlAB2hAIMkIDGdKE9vHxFNU1VPWGBB3MfQllfkg7rnUYN+U0mQERs2+5ZkIr7zC Wx+Q== 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=x25JE3Kc6tv/CRPnK8Jr5HLS2sX0SCmIF/DAVcH2FqE=; b=C+jFOAtXd/OvNuP90T8hRJO1DdulxIAf4HFHo2gRVU82e0saPo29BlFlEbyjACeHg4 qAyBGosV9gfBfkGzbhu2OSL04vyvaHovcKuPd27RUwUR7fnHsji5lqLCDW4dlqReqZtc L8j5aQb1/yo4fN5k8osNcEicmyZYuNFmIWX2wiw6CUCU5Z4oHsElae5zMcbb32Ol3L96 rH6DkGAnZ252j0ArIH+S9HWSF5DfWfR1inRsOv9cm7hgmzQr8/BClHX0isgX5CKWRx48 nr7EvOlnONmIdLaYG+8DiPEgPABlw1l10qGU/0Ty5BFVSERuUZv+wIGwVFUg4DkTGU8K +qVA== X-Gm-Message-State: AFqh2kqUoNnsFqIkyM8Qr5JykbWawUdVt3jqaEc8Zz66Y1j+xPzm9EpG AVd4BINTGF6zb+kFpAYxryo= X-Google-Smtp-Source: AMrXdXtcJ2y8j2tl71bGDNWcQ9VdexuFiNN6QmVTJEdgM9Lahf3FnPeatjjBv8JIR91dEL59PwjIKg== X-Received: by 2002:a17:90a:930f:b0:225:be98:f5b5 with SMTP id p15-20020a17090a930f00b00225be98f5b5mr45592480pjo.23.1672866914778; Wed, 04 Jan 2023 13:15:14 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::a55d]) by smtp.googlemail.com with ESMTPSA id i8-20020a17090a138800b00226369149cesm6408pja.21.2023.01.04.13.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:15:14 -0800 (PST) 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)" , Chao Yu Subject: [PATCH v5 13/23] f2fs: Convert f2fs_sync_node_pages() to use filemap_get_folios_tag() Date: Wed, 4 Jan 2023 13:14:38 -0800 Message-Id: <20230104211448.4804-14-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104211448.4804-1-vishal.moola@gmail.com> References: <20230104211448.4804-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DD387100004 X-Stat-Signature: rtpkgy3ht5f358b5f3fuhq6tknece5a7 X-Rspam-User: X-HE-Tag: 1672866915-756214 X-HE-Meta: U2FsdGVkX18SrilJ/3KH1hpxtLFvycaXE1UkzhHvIp49pVnSsD8611676m5CqVA0Nl4nglTBOz5scL1ti85ZBgzCqYMQHdQm/x6XB/2qVOIBXgEPv2NkWs5RPw3GteRDZFUbG8j6nE7CHtMtFWrA/SNJ7VZ6Fl7UUKL/Grxzv7IvBP4TRuUKS9D/3uIZm40zW7ISCne9x7obBvEaD7cOhqSknEtbeZdTyi7/IeL3t82UJPPmIGGrAYh+2Efn/vcud9SR/daIjL8+99YC7r8hUIr4w+RE2yV4FTYIoNoHpDB95oxLkSromiW/fSUYB0TqK7gVKEa7ruiv3HnAnWjuoSacRyU3t7VG3FwL03OLvBgsePt+Yl5nmtfC8JtOBnr2WI1zYQSzXunC800EbGm45tyCg4gxjg0VzEg8bMKZ2IS8ITd5Gx+HEO6rxkA3i/Q8IAfFJCWhqgK1fiiS2uD/uqWVDwWHpxHQKC778xxtmoOZw7KHYdUeNkq28thEfsqYSKdSQxcFhVS1CSSfi61nyXMX1RUTEQUdILxVSTx3Mh48W87gg2s2TsHgDLjOwj4HFA4MGjctTYc4EuryP3n0ApJWUCGorLjmCTLqsTag6/s3D8nDszeue2GzjImUn60XNLyRtu5MDVcuvxAlyeCSk5ASrmT7XA8qnFLZS1g2wthrHNuUjFphxaYFLNtFxyoUKyw9wmlQuSl0XAxqaZPX07SaGaf1QBJuSb6W6a+VqLrWETU2ax/Pyy7yaXzbdSLNkhGgVCA9d+4iEmpS+F2ZCFDSvU3OHPmquY6RgoEcy70vkYkzULccZ0COOvwdY6L9SyCPMM1E77Qni8pWzfV3j8YGMvwp958yomjiL6Q/NzC2qN7lJOfY2FR74RQvAtlWiJELSMilL7kWRiXGzxRV6Wi13w0sGOY5ZSG8WarpkcBZBadwJ3KXh9rOvyMTiaVkucLJQjEBfNHMD0kQ17x bLetmjGm E0a2+qWBjvTWMK/bPg2/k9BSRUeuLxbWp9cViPy19Yfd8L4sEHmZ5P0adyvSdXcHcELx4ELh3MzFBVq55IM5fkPetG8DsQr5qjzrK9cEmXXhxNVLsIkLXQQOUEZfiE5Tb48+sGP7MZbQaVdrPqnmnei/5R03sYAOGn50RlTnP8Gw87zaZ5vGSUMnr0kUrXICTViktVQ16VfzGObxykewId3zMKaHtbHtNQx0tj2qVQokgcRpxLZ7J51ZvUHwGYdzZo56H6u6JKEL4/aI9fBsygOKc8w== 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 1c5dc7a3207e..51e9f286f53a 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1938,23 +1938,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 */ @@ -2029,7 +2030,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) {