From patchwork Sat Mar 2 07:00:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13579439 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 7598EC54E49 for ; Sat, 2 Mar 2024 07:00:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4581F6B009D; Sat, 2 Mar 2024 02:00:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 407D06B009E; Sat, 2 Mar 2024 02:00:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BE486B009F; Sat, 2 Mar 2024 02:00:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F268D6B009D for ; Sat, 2 Mar 2024 02:00:42 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CA4DB160657 for ; Sat, 2 Mar 2024 07:00:42 +0000 (UTC) X-FDA: 81851201124.16.EF21F9F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 4A1454000E for ; Sat, 2 Mar 2024 07:00:40 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=TXgg2Dk5; spf=none (imf04.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=1709362841; 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=6+DxLmD3pWYt62PFpdwDHTX1k2S+K5LWscwMe4aPqzs=; b=aDHl8aH68s1AVWLGi9toh5+aCy6xiQXih/0zwkjS+a25QZHUT3XRnpExXrRwWDNYb6g5u6 eeN6CgnVX+7/FjS1WRGd78/NRUZAwLh/S6CIgZpvdnKvVWXk+aVxt9t4b64HJd3gJq9jZy o0OKjvW1jB3II8RbbeXsJDEPCptrWhA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=TXgg2Dk5; spf=none (imf04.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=1709362841; a=rsa-sha256; cv=none; b=SMuiIz9MJnXMmcHm8aIFbMY9d7juNfIa+4tKrHLf8uUktHGyrXzOeL2Yx3iwFcw+CHte0m cFu6aMMU5XR2ycQlNVsSaWEYAUwFNvXu2QDqI34THsVhwpLDFbULkTzBWIziWhB5Ot4b7B ssvkPiPh13GOSB80B7TtxH4lT0lgG7w= 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=6+DxLmD3pWYt62PFpdwDHTX1k2S+K5LWscwMe4aPqzs=; b=TXgg2Dk5ifnFE9JbEddiZv4xGz 4xcJCa9QlpLFsoxs0Z2CUhvTucKpQg4KVYTbGkmkU1RyjYUxcRcrqFOgPJW/OifcV4YqJqD1yY4xk PuZkHUycRenvNbP5kYkNtZdI9+OHvsRZ4jkMtLsgK0VduJC4zXmW1xHQN0ChIQKOqPRXFFgUGvWhu K8iJQ7ykZimym+u1EwMLv56QzEPUrlbb3nWd1pqPKsJpIuy1sTBoBxmZsn+THVwb/NSld4FFLILS+ H5Y0q4cKIKYsJewGULO37YWkwJDwsNgp1VpTrnJTSygZDV3C7DdRpof1x9PAkJqo4/FjS+/NZzPUL OVcqUulg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rgJMH-0000000D2fe-20Xz; Sat, 02 Mar 2024 07:00:33 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , Kent Overstreet Subject: [PATCH 1/4] mm/swap: Free non-hugetlb large folios in a batch Date: Sat, 2 Mar 2024 07:00:27 +0000 Message-ID: <20240302070031.3108523-2-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240302070031.3108523-1-willy@infradead.org> References: <20240302070031.3108523-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4A1454000E X-Rspam-User: X-Stat-Signature: nrjep1d9bpshmzd4hemwih1yy3ktosta X-Rspamd-Server: rspam01 X-HE-Tag: 1709362840-49696 X-HE-Meta: U2FsdGVkX1+BS0KpUt3pZXTrk3dyY8990749NXSEQn8zUil1bzfyPqRkgFvaes0F772Iu++D3MtH+AqS9W5XI0oT4vWgm4SKB6oRGuupN8Rx+qfhzM0IQWCM2yE1rDmnLSwhNdkHiI2W3zJ7tIfsDgDZ7tqdIWWxrOdez4TnAkQZOwiodKB4OUE7ZoIvLDfuViFgxGDgsfZCQHEZEc/d+elhu6jgT1dovK15lD+fURTwuuMKh19idaipEs7KzTJuCF9oYZcQZ9YkAh0p21XWBN0FjdB322gScT4H1PmBpAVrm7wpqk1HMkrxunjos4bgFBMLpXYLK7B7fRW3eJf3zcC/pPln11ahMcZlZsvoNhMPTLCDi70w24D5wm8ee+hVuBF1EIYpg4ABqpyXYBtCOuzhM425UGpEwcq/U3rvFKL77F3fVv8PHWnZxb7PiyIBGm06Va2CrFE1Iuy3Kf74veupoE/VnSr5iH8PSkj02zJnF3vktEJfjIbZTPKlviBMPPVxZxFshMAPNJmlevARgonMKOPPGu8b0PKSLUF3d+mxRCrtkfZ4jklbvd3CshXQaFujfbucenA+IQtomVrFZ7HkI/ueysK7SjJjki5edFABY07tJ+LUKn4ENVk4enx9l7ykR83/uBTIUvmCjKU7ix2mnbbcj0fbkKR96KvVYBStNJQu4PebWR0HVh/0fY9bF8aPtoieewGiFFZtNWW1nOo1GReUdpzAq3jwlF6Snz6Cc1RsFMJCGpK3f1bffqTiGnElLQjQe1Y99MBuJSvINle12l5w9SjJOQnUPXrK+d4soRLaphYzYZrAceDFWJblSQ5AMYsRodZ+udWGY++e6gL6mHqN5I61+qBgqltboPFOMUXunmT+tQ== 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: List-Subscribe: List-Unsubscribe: free_unref_folios() can now handle non-hugetlb large folios, so keep normal large folios in the batch. hugetlb folios still need special treatment (and I think they can be freed this way). Signed-off-by: Matthew Wilcox (Oracle) --- mm/swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 6b697d33fa5b..d1e016e9ee1a 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -158,8 +158,8 @@ void put_pages_list(struct list_head *pages) list_for_each_entry(folio, pages, lru) { if (!folio_put_testzero(folio)) continue; - if (folio_test_large(folio)) { - __folio_put_large(folio); + if (folio_test_hugetlb(folio)) { + free_huge_folio(folio); continue; } /* LRU flag must be clear because it's passed using the lru */