From patchwork Mon Jul 3 13:53:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13300153 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 811D8EB64DC for ; Mon, 3 Jul 2023 13:53:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06E1490000C; Mon, 3 Jul 2023 09:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F12B690000B; Mon, 3 Jul 2023 09:53:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D64AE90000C; Mon, 3 Jul 2023 09:53:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BEF3990000B for ; Mon, 3 Jul 2023 09:53:49 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7A82D1C8991 for ; Mon, 3 Jul 2023 13:53:49 +0000 (UTC) X-FDA: 80970443778.07.0F63DEA Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf25.hostedemail.com (Postfix) with ESMTP id A3988A0004 for ; Mon, 3 Jul 2023 13:53:47 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf25.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688392427; 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; bh=qDlU2rGsKBPfwZSw0bLPzWmjupT8xRy+8rDXmR7/VPM=; b=KER8PTTZT0is1E8H+eWkGO0q4ER8rVajpQIOjDN0z8Yl6c3DW0agX99hgYejVnY1Aafvv8 bdvdZVYqjfWfjR59PhYnH1PrR/L5lrR6xQwqAJPJxhJvRXqyARD+zJ668CQD1BxMg7FhNf vuzuH43IwzcZqFsnWyQ1dIehgQxyHCY= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf25.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688392427; a=rsa-sha256; cv=none; b=0KgSvbZDrxmFao7D1eTrH/ZpgLqlIhyxgUVAiB7CeWIDvLqZLJeFa4KPIhYFpPKrC8mJYp MqdlWsUwUV8OslwGgWgwbd6SQXNeBCJ5mbgULorh7sMAlSORia1nJi8dqbA9rJrInquX+H lf6n5QBeEOoOi9/KqrtEdujlKYGhgjc= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A42A1424; Mon, 3 Jul 2023 06:54:29 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E6A393F73F; Mon, 3 Jul 2023 06:53:44 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 2/5] mm: Allow deferred splitting of arbitrary large anon folios Date: Mon, 3 Jul 2023 14:53:27 +0100 Message-Id: <20230703135330.1865927-3-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230703135330.1865927-1-ryan.roberts@arm.com> References: <20230703135330.1865927-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: A3988A0004 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: sm966ht6xraru6fhm94rim5489ugtfjn X-HE-Tag: 1688392427-113007 X-HE-Meta: U2FsdGVkX1+FmGH1wXy5DXOQBvZ3PWqc+q+78NH5rW/dZdOWw/W/0ZKxDDZMbUu3Eu0xddQTiXYS2zmuQTvemHABwzqR1kRWND6HgCRL5IGUbtoHamBLFnT/sqYJw2GX3EasDW8c3hDgwj0vQt+bCw7RgfKef03O8kbwxnKLBn2tNr7QFmkavmWyxOBlzuEKIfOc/dcxVHyxYqQn2zmyyUZh3fozTLehEAl2UQt/gQFPas8XeJ7AwdrAFGjxCtkLcHeWDD20u1nSy9F7dh28M2+4dTntIiomPg6kUXhM+J426RBh3opmfQMlnlsplOdHBcH6Y1uY5KYsi3mlJWaQ5zFREnXrbyF5QVzWafmxuNsXX65P1S7+bUYW96zLiFgrF/4dPJBtowosT2HjpOd+4rZ4SKFVkQvNKtFBUNS3Ys/q0pBDWhHp1T+wKVfPXpGcolm6+7UyAFeZceOpA/IQGfl3ZMspLjWcAvG/qVK7a8bVrAFb4579kGWV+ReZ552DZnvuJZNst3xZhwwbXc+3XzCC8fNcOucoR0qpeUB6kxszlOiDaMqIRqcUxqvk8yMGzSsJEyFoWlIDiZYK9gHjbEQlvgJ1kH4BmhXycxZluyd8HGVhNCmOEh/PUbft9TrzdnhS6dTzOA+GWprhQOyFqgIFf/OYhgnlrceBeI/jWlm6gWnOoIt6EhdNXixUa4lsKXYNRM2w3VwLnk6Qk3rix7L0ryHEZKDfUbAMuH8W8xd4zdH5YuUfVrphycjTP8cvdpAn+i9OzvXfEPm03YgxsK8Azsr5lsg0MusR7yOuLZCphyNV2enJgyHEaRRryaMzDjyIHEiDsTEfWtS8HgBeIvwRygWupHm4yWmuLjoghLP9BrTDDixHB1DRJDsil/6EdZOWwoCq8i2oFraswibYntBdxEheZYL+YVFvJUMYGs8kvZ7088xMbnUfwEqkLLvVuqOSITL9m5KX0dmETri Syl602B2 BtcQruhNmdjG9UCbpMFNBBmeotiwPrTv04qi/7F0HOKTlWArM2V5Y401yyl1Yhw1WKB/i9XvWSC43cONiRpnOupME9ZWSEa835guhOu12Ew1AYMPgjVP8QjkOdY3k1KmTca1re8cGQpD1ySSiTCcjYtOt0AQoKwIZASfVyc6XbB4NCpeFvAbx8CMov2lWvf/AtvfLQgPPUy3mzfI= 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: With the introduction of large folios for anonymous memory, we would like to be able to split them when they have unmapped subpages, in order to free those unused pages under memory pressure. So remove the artificial requirement that the large folio needed to be at least PMD-sized. Signed-off-by: Ryan Roberts Reviewed-by: Yu Zhao Reviewed-by: Yin Fengwei --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index 82ef5ba363d1..bbcb2308a1c5 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1474,7 +1474,7 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma, * page of the folio is unmapped and at least one page * is still mapped. */ - if (folio_test_pmd_mappable(folio) && folio_test_anon(folio)) + if (folio_test_large(folio) && folio_test_anon(folio)) if (!compound || nr < nr_pmdmapped) deferred_split_folio(folio); }