From patchwork Mon Aug 21 20:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13359800 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 8A594EE49A6 for ; Mon, 21 Aug 2023 20:44:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA78940012; Mon, 21 Aug 2023 16:44:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A9D9940010; Mon, 21 Aug 2023 16:44:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AD99940012; Mon, 21 Aug 2023 16:44:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6028F940010 for ; Mon, 21 Aug 2023 16:44:40 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 368B51A03E1 for ; Mon, 21 Aug 2023 20:44:40 +0000 (UTC) X-FDA: 81149290320.06.867E027 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 85C8F2000A for ; Mon, 21 Aug 2023 20:44:38 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=v0t2Syi3; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692650678; a=rsa-sha256; cv=none; b=3tzsEjQHQJmXSX0KJMxg6oj1+mmwleEWXF+uUrX5XnW8OQd/xJ1J92fC4JIgDj2ncbnnbU lrVoqUSy98BcjIp3i51Q5Eb+fk5lO/OghAhpnN56bx5xz9o1UQsh2NwAsjLs4rPDC6y4dn TPvT+RaKXjvcixS2N2c+hW7RWurcGZY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=v0t2Syi3; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692650678; 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=uZKmm6KWu5gIA8MZSDwDZfTtk9T5DcLVj5SgxVN7+4w=; b=6VxYqyD0sx0WY256dZyiLm/luqCQ03X49kZo4fOZR/59q0i6L1/V0koKxED198WfBG7gLl lnZhYmRNH1/os8qBJ6lejwMBfdYsih7MlO1QnoAnJrdI/P2xYpFcIGt4VMVbAYsA+Ppr/s m8LV3rdpoyOmMloAwTYWsQdwgyPDpDc= 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=uZKmm6KWu5gIA8MZSDwDZfTtk9T5DcLVj5SgxVN7+4w=; b=v0t2Syi3ZRpGhRgAu0OekJV8fg i1bZOE90UDMiASJIcuWOZSxmfOOePDQlvt8HvZfsbeZ6oq5e/e3hdmJa6CjWaFDpueGvhk5C4O7RG mM3iWkWtoMQIoEsJRcifKq6bTwVt/5uIPogb9Y4GHBmo/+CAqeS21plFM9t9F/hJ8SyqTLDKZw6ZJ fl/px1t9awQR5d266OlhyEh/q6fQ1QH7FNmMZYESIgL6huigzRGkKtCQwXvAWgD40tyLj/m54ZLp8 yj46PeNE7g2cbyCrU4r6JMxWVOD71/V7EEtmktVZCqtbvz3nLMg1bcnMJF1HOVhJs+M4eBiIC1uZs 1Z1cVBng==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qYBlE-00CL0D-RA; Mon, 21 Aug 2023 20:44:28 +0000 From: "Matthew Wilcox (Oracle)" To: Mateusz Guzik , linux-kernel@vger.kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, akpm@linux-foundation.org, shakeelb@google.com, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 4/7] mm: Use folios_put() in __folio_batch_release() Date: Mon, 21 Aug 2023 21:44:22 +0100 Message-Id: <20230821204425.2940496-4-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230821204425.2940496-1-willy@infradead.org> References: <20230821204425.2940496-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 85C8F2000A X-Stat-Signature: pwros5auw5ac663w641hpifnngtkibt1 X-Rspam-User: X-HE-Tag: 1692650678-342975 X-HE-Meta: U2FsdGVkX1+L+gM8PteIG3TmL83iXu/UWLMFmq8KMIgDJl3ylSHNzx3aX1217dyZOMyLLN4oBFpsp5cpTfhj5niluaQZx97GAuTjrf9bmdmEDJKBVfyD69xDeEjpXXSk45AisvpkKibF2HT0Bq1Fl0eJcW/bv9+kcPruKSVjOA9VaU2TQiAVDpeENzkxdC8ZsVd66/Sb1/NOBzt8fBW9YHiC0UegFOzb0M3t3u0bDgNm5VO0sa7t9gC/0AnbJFq1JpYpOSAVOdP2s+dg9WfvXX4jzAogkVpywOygJNmZs7T38uT4k35rQG2HV1ShYln6jKsY144RAYDjiEblTai9r9SCUKFSp2k9Qfgq/mSIMkd/pQKNxTeVZT3qReSpmmWZ4iMOADXn0isdaa4j5xhtccUXgPWjEFrTY0Iqtqy/bVSq3NN+7cPbIs6fi+cB69ogmCzf05sGvWxT8zotGEWoSHeH8Xpx/MvcRxx5ZMOUW2bsEjZ322oylVBtRhSW3MkTKtn7gqRNeqRAzt6+z9m/FA1enH9e8jShdvkXsPF4+Cay4JH3EAgL874iz2Uq1mgPgkWplwL3YTch+aUGP77oUrhBlowHt5R7vzODDrX1l7MG23lXA6md7ukgKZvZW7e3h0MT0jl6eBx5K/fSK2MLFq0cMMJ5rDXItS+K66WENwGlsRo+huTVCDc2VPi4WoqMMieMvpgEnQ4M4VW4gNmSxUPUsNwazV5sRenz1LJifoSd+pkn17xLM62UUuh66GStnmnZfjlaEUqaGFja2Kndwz3XuM1rBZ+9gemdneuiAGuqoH2mRCwY4Gsmkq+gJiRPAY4Nnn4T9EAxJcaCgXSknuEXjFIC+fh1bXxxa6I4wfP8iuZ3kCY6X6ewOpeEFgBd0cZOwxPNRy1UQGv5eQ1YcKQRfnY+JvfMJGBpTGtuxqfuOHLZYqz1eQKyxYG+RQ+lt6A1+k27KeEuGCYipCF EVxvw37h 9U8LFD4m04OnvRX9WEyWSOUX1YGB2Blqins6fQ+u0ZZTNs3Sb6nAjwZSmLev+zxzpGa1uJWz+9cXJyihpVdxhz/d7g2mnZYgLqsDjDBSCN46NTUJTP3XxhFa+RAFw5Ty0q4MkWLMZanaaWyzfpKVobVpfrQOePBZkjmYarYTVp84PrML0vdxwOlhez2rt/C53KO9IUG3941txh8uFicgSS1zd/+0NyxiqORY0 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) --- mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap.c b/mm/swap.c index 11ca25d4843f..9d31185dc27b 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1072,7 +1072,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)); + folios_put(fbatch); folio_batch_reinit(fbatch); } EXPORT_SYMBOL(__folio_batch_release);