From patchwork Fri Aug 25 13:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13365801 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 A0342C71133 for ; Fri, 25 Aug 2023 13:59:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D0082800C0; Fri, 25 Aug 2023 09:59:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B720C2800C9; Fri, 25 Aug 2023 09:59:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3618D2800C3; Fri, 25 Aug 2023 09:59:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4D2DC2800C2 for ; Fri, 25 Aug 2023 09:59:26 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2B354406C2 for ; Fri, 25 Aug 2023 13:59:26 +0000 (UTC) X-FDA: 81162784332.12.2CB0F4A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 6E61BA0024 for ; Fri, 25 Aug 2023 13:59:24 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u5AMMwaL; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692971964; 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=XrsnVnR8KiSf3aJSJOgE2uWljs21ZHQ5GjL1P6Fx1JY=; b=nJymcDaP4H74cHvI5Vm2D8ehIJKp3JD4bLU2CdEOaS6wt2GJLfxBczRfFe5xK+c53KEFHH oY73+7B0DeTQYrcJhCRITbyWCXLLldlvKnhULAjIouXi+ciROQp/U+gRfptBfxnowtcl11 7WIgcpqwuuY9JSho67mshE8wpyC6g2c= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u5AMMwaL; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692971964; a=rsa-sha256; cv=none; b=dsgE74srBAwkWEvd4SCFeWYxz3GmYICq9YVeafVT+DeGqlAhs9qrFGmrwyrTHBdMJNvlDe XiJSVJLcDH9U4/paADCvkfUs05BMiTtuO5yngLz3uaxVe0Eiv7+frt43XyZDPyCsxt6+rY sKfXsSnGihLDUl2Hzdv8CtyZtttBlY8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=XrsnVnR8KiSf3aJSJOgE2uWljs21ZHQ5GjL1P6Fx1JY=; b=u5AMMwaLi83v019OUH8tZ+fDhH aoRucrIX4va3o3SCykt+Kqs47qLg8oprESE+kAmocXNYgSXjwnJ1QoaOUNqad00A5HNEfjyjwVOKL BJHyCVV/9cZn8we6QXHJoK6NODOkQ2qL6Qtv9y8AUV9ihLcYOl4V/kViXmaqSstRW8UYJEvUjrZe6 7tZctd4htN2ingVQrE9ID9xKWy78LjeMMvEdycwodbG7zIaAg3jCnTr+6uWt7DkjjOiB6JY48z/kH Ui5jmN1AG+nsBAkEE1c5fzAbH5myoV/4gP2ecRNYhfEhYD8gDf/Hnr+U04tKGay+zrKMNFSryedKM syYN30Gw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qZXLN-00HTQj-BC; Fri, 25 Aug 2023 13:59:21 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [RFC PATCH 04/14] mm: Use folios_put() in __folio_batch_release() Date: Fri, 25 Aug 2023 14:59:08 +0100 Message-Id: <20230825135918.4164671-5-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230825135918.4164671-1-willy@infradead.org> References: <20230825135918.4164671-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6E61BA0024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 3ph7gp17ntdkqgynmpf45dnhtwtu1jzf X-HE-Tag: 1692971964-58703 X-HE-Meta: U2FsdGVkX19Ocu96P1wnaPPLg12+iuslFgelB8KP4l2W1o5VLXLz89sIQVRC9BLSIgxUXr4KttdjeyBuWXF3xbNVUiqsS8+RSqljQjVV5Le8bXDGB3jLRhK1C/GyO3DM4OtsWwWCMswN85jNryYHSOXuff7CGB8IiYZCTs0unlLAIWmCMPsy8cWLIJThRWn5kasuLreUFdc9N3UK58ccGhGBADoXmvnSRBAk5Pyz2a9pkt37mMjPgVkkspkPPowFU8PBla5Yxf74ytgthXtRNlGJjcuYthSgKcipdqgdXkK2AK04PHOUiNxs71oC5mVwby49YPBAX/sJXa7tWtvKv1AtnNwQS1TYrfYkGfze7iArqzGj1z7zTBGakei3Rn1JZVTNG0G1lWdRk9ZESRh1loeUoQNoJZ0nwlqkFvsoeqxy9XJob2wuanW318TTtmN6QDaWbEQS1vAoPahvlGwyVgbj9o0Fg9rgHFBRzjyzFXGW6BeqxQANoRzIcxnnw0BHHT93FA8E9q4NyANKPwDd6t40cLediI5LIZdLZafhwtZvPnoRmReuXGls7YumxEhq2WYccco8gv7fO+UjW5kL2S5tpgDQ2xpTzmQWA3d28xlyqR3mbm36k6ZY72oifJXpqLfQUF9jeghXo9v3MXVmCUJFH6dpapmd5wh2xkbIUrqUrgGebytR6JLmy3eiFkW5uwK2agKX69sjJpD4VSt/ThAvPjpRzYFORfMa7kLMik+GutOUONNWPbkWKVdv92C7D68dV+1sPF7vdnYtSPr6yKj/enbQ8yxrZeJOJdi/sIs9XtWET4PbunCqkKfLSk6GpcGA/k3MQs4/hez/zUYmIbsj1Kr3/tuHfoNPeQGIPbjKUcBHACy00wGCMcaeCnSaQ5yuQwIr2UqUmd97DRhFb4XaLdbL0VZlfy82Fst8QZo4ZMTpBrMCmNGojsW/uVIv/M7CHBglbSbWaVE9Uuk 3geTUGW/ w9g1loAtUSs2f/egUU9AbpMJWdUb8yxV6rp+L6pTv2Ae5469rb/hsevuvI7GjATqTGlAWEldmYqcvOUDoC1WGaN8nT1Frih/hOPM47z45NvVF5a/Xz7GnnkYvAeMl/bvwou/bQ9PbDntjn9pooif3/Pr+bWR3/LjZtHPk3yag7LSmGbd0VP8vRz+NcUJfxqw6cDyD9MQy4XXTilFJ7jXV9od3DifhDNW+snsr 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: There's no need to indirect through release_pages() and iterate over this batch of folios an extra time; we can just use the batch that we have. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Ryan Roberts --- mm/swap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 7bdc63b56859..c5ea0c6669e7 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1073,8 +1073,7 @@ void __folio_batch_release(struct folio_batch *fbatch) lru_add_drain(); fbatch->percpu_pvec_drained = true; } - release_pages(fbatch->folios, folio_batch_count(fbatch)); - folio_batch_reinit(fbatch); + folios_put(fbatch); } EXPORT_SYMBOL(__folio_batch_release);