From patchwork Fri Aug 25 13:59:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13365803 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 54E1CC3DA6F for ; Fri, 25 Aug 2023 13:59:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A83958E0017; Fri, 25 Aug 2023 09:59:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 22AA92800C1; Fri, 25 Aug 2023 09:59:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 704502800C2; Fri, 25 Aug 2023 09:59:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B973F8E0016 for ; Fri, 25 Aug 2023 09:59:26 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 910A412067A for ; Fri, 25 Aug 2023 13:59:26 +0000 (UTC) X-FDA: 81162784332.09.AE64896 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id CC493140017 for ; Fri, 25 Aug 2023 13:59:24 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=KYTHqTRW; dmarc=none; spf=none (imf23.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=1692971965; 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=4Iv8ImNVozk3626iD9HCAdyqdorH5iCsCnWPrF0esRU=; b=oi6G7aJwq28BHujb+z7wXMjUOFQDwAiOiEWEZBRVa3mWfM8IZtwLYPg734AHTnHvi/byMO R598v7e7DctRN1is3QUEqKKrg77UbY/jBrfubBLSk0qNl/NLkT7aN1LdyOt2PkoSe3TB9l C8N6wb9qgXZttVbMxLHHm4QZJQKDSNQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=KYTHqTRW; dmarc=none; spf=none (imf23.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=1692971965; a=rsa-sha256; cv=none; b=B0vyOjdyAU678RRO4rdANkio3ngr8BY64kNP7X0GlfAXP26oCc55FuUtrfRdZhcnVTw4WR pw7NMjtbomDMB6edfoUXvq75aNDGqxQszKOfkjFgoOXJT76oBXRTvwe/3CcD6/XLSbt0SL +Kh6xMJroXCuRdrFpjJNkT29nwHfQnI= 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=4Iv8ImNVozk3626iD9HCAdyqdorH5iCsCnWPrF0esRU=; b=KYTHqTRWvVMmdXqO7qT5wXcFdZ tceHMO2eCIDiMl3GEAEAcX8Op8M1N9CZHzRRpW8VVerQNFcI7AnbpaxCeBqN5bWllDDtzKnvognRt M/MGqRbuMZSWcZM0os2IulywTcATT458+MwDG3m2pAStVWa3BtsrQjoiEjF5UE2KMauMoq8x9E/t2 raIhy9KXGwb3D7pYRMorFEwOkG1m1FM0UoZDoEQ86ebGQzqUu0JUjjwlr3rkceucYGlzVce3Vhndq t4DKlr4ww3Dhw73eLrqv8V7MTCoj5t0NkPfmg87vP0drBRiSIDxmF2mhJPrMd+iyQml3HgOThHUjf 5PL6SQEA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qZXLO-00HTRD-2Y; Fri, 25 Aug 2023 13:59:22 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [RFC PATCH 10/14] mm: Allow non-hugetlb large folios to be batch processed Date: Fri, 25 Aug 2023 14:59:14 +0100 Message-Id: <20230825135918.4164671-11-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: CC493140017 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: yedhdib5pkxrzxjsnb9y9k6stu5bn3as X-HE-Tag: 1692971964-500558 X-HE-Meta: U2FsdGVkX18RU0IVuwe8lL49SUs8hs1IDb24J8xTbWGwHYEjWiEUBhnMcmhAwpJML00Trpny7CqXDgGoEbPe9rsW1BQw2B//ucLzzuYgqqfzIlhwMOZfS83zxNSJldOB9bhAVskx40uh024JViWZoIIEsDCOvnhO7wQK9R2bDDcrKT8GAQcUz/LwzL6HzScmVcYVN7VtmAbmQ6iMmkIpex1ZAq5VfzHv6Z4du4UPK3hATl/9wPK+GxfFoWzyMBukVUD9DE0Z4qgi/Z1OMKeq926snh06+WHJKr2VhK1sA+H3XFtM/3pYDvraaCdBwxsbfaBirkkVeV4ujp83nUbYgeJK4RI8dTzdzTD59zXEfOTJgswYbbxq5VW6kJpqn60xBmeZolRZNNrqQzvKeHUk43IL4lTNPrB4i9QKRxlTx09ZnCy04peJ482gcwzQddnFKOeyddQPlOmCuG6185P9RDkIUG+lgo55OnLUIWQ51zsqxgtI7Uh6RvWEjshRwGfDSUg32xWEP5dAcwxgWhIBPKccd+dfR/qlB6wKEXI3wBXUXZ4o9jz01NtAgvJD5yuiev1TzY+El7lRS8eUuFhQVlw/A6hpCDZZwFY6QKZpkh7pUt6MuI8THNGasDIO38xUX3XFHsyStimH16iu+aDxFC1Gq2uUu5XCA95yf5EEp+iyezJMl0+4++K6iKoL81N1YUfWmuuJTxkvekSrPvg4OwTz3xv1bd9NwenppLGRldMQseYAjz5UhnTB6HUrTo42L40FQMXQTmBa9Qte6GGWelpsbiw419hoD53i2KBZ5rvGlyFZzLWHR6galbfcKkNoZvKyC5uJXHcNh/SAlnN0sU9JasWbdBugfPQZxXW6C7X4DhHOxG7+ssNJ6vczGgP2HI7fKiDvY3cQ/GLKV8O1EHn5zm3/qBSfbaUbcqACwPTr9ALLjsuk+4+DPg2IbLTnCOJhdxK7fiBII3x5FKa nLCyMLQ3 muxepq2VPJU4v0oRPSMHtyWzQrls0xn3dEZfwkVFUtZecnkjhaMah01LA3t9XTKa423Mm6Ir5UT6q9UXZIurlucudPjSFDiTQH++WGIb7S3mZfRObSmHdCxyGymsuenwtpCj2UeStPPKULJRt6ZtI31WeoLk+l+v3JVBEccPHhY3ZNds83akV7G36rw== 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: Hugetlb folios still get special treatment, but normal large folios can now be freed by free_unref_folios(). This should have a reasonable performance impact, TBD. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Ryan Roberts --- mm/swap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 21c2df0f7928..8bd15402cd8f 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1000,12 +1000,13 @@ void folios_put(struct folio_batch *folios) if (!folio_put_testzero(folio)) continue; - if (folio_test_large(folio)) { + /* hugetlb has its own memcg */ + if (folio_test_hugetlb(folio)) { if (lruvec) { unlock_page_lruvec_irqrestore(lruvec, flags); lruvec = NULL; } - __folio_put_large(folio); + free_huge_folio(folio); continue; }