From patchwork Mon Jun 26 17:14:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13293235 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 29EBDEB64DA for ; Mon, 26 Jun 2023 17:15:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B64AC8D0009; Mon, 26 Jun 2023 13:15:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEE698D0001; Mon, 26 Jun 2023 13:15:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DC838D0009; Mon, 26 Jun 2023 13:15:02 -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 921468D0001 for ; Mon, 26 Jun 2023 13:15:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 532A01407F7 for ; Mon, 26 Jun 2023 17:15:02 +0000 (UTC) X-FDA: 80945549244.11.8D0B734 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 8E32C4000A for ; Mon, 26 Jun 2023 17:15:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf11.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=1687799700; a=rsa-sha256; cv=none; b=35hSiAVoD9YfH5OhFyaKG1eFZnRGYU5Di6lyiCMpaMxYhNZc/ScVHHPoWZt1adpTI+LPnG FFaFNh2l6qmV2n34vwm2v78uTzGYAIQCSnAW4nmwHrgVFM2dWAExZU09RAed1Hk59tPvTE /ALKX8kh5T2DnFX1rTdv9AlXS8y/vV0= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf11.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=1687799700; 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=9LDnxtcMGKzMwMeO2DGDBjGbhx12txEm8328niFWh5M=; b=aN7LuhG5A3Gh4QFrX/Bvjbd74hhqTqShLDBeDrguVzwAZtGXo6X2zEurqbesego9JOWJvg HfMGuImjJyKpfM9lZQxIkkOVQVKrmrz/3aXwkXpMQUKq4hKPP4QaUqClWZp6dpZ1Xfl8IE 6P8Zps2XWTKnhwp0wekKSijNe3amQWU= 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 94AD9152B; Mon, 26 Jun 2023 10:15:43 -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 AB7DB3F663; Mon, 26 Jun 2023 10:14:56 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org Subject: [PATCH v1 06/10] mm: Allow deferred splitting of arbitrary large anon folios Date: Mon, 26 Jun 2023 18:14:26 +0100 Message-Id: <20230626171430.3167004-7-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230626171430.3167004-1-ryan.roberts@arm.com> References: <20230626171430.3167004-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8E32C4000A X-Stat-Signature: 6sfpnth7dzgnjmixfot589ajgtiuercn X-Rspam-User: X-HE-Tag: 1687799700-537119 X-HE-Meta: U2FsdGVkX1/UCvXlJnFWQza3NP+WmTWce/2deM3afEgU3XoP0mmvonzjnJeNFXQgKjp43q29JMBtiFR+3bjTsUYLHhWsrKkgV1rpDYPprpDJkSd8J/ZbQE2nlr3McXvzATTbxxiDO+ErWnNJfe7fXrK4RhpCRME2Zi57a2PRU6qxlcIEJhDtwDYg5Cc3OpOKW3Hl7+jVQVUbE3jBOXk8x7GhTt9RY2ZFeJ1Rjim0ZLPB5FGlZl2ZU3NNIU71UJ0wh0YdbNQHTxlMaAwoahMZEt7eVGAif66rbIUkgtcAhcHcN4mOa30Aj/X2HSFf0+77+KJGXlkeTL2Zi5pC4Z6vV9e3FBAbQFd6I67yb1as/jRS4L0bz3qtxrpI8XYaQ6dUTAQgsmzhGv5FmW1M2tP4L5iVzDe8ggABzlFi1J/9ZAPynFfVZqeej9ftGxEWKJyfBuRi6MlXSoNPNjAr/p1+xPOS2Ka9u8cGCkBJ63PBLSTCHBA4O5VI/0bkt47UEoqU7OMOOGy3oF1JgSyDifriiPXBfq45gjZHq1QGSSeRxCf9/+ZnzcqTUSR3DNiJrhr+R2bdbyWHp6B9Q9aN5vHnmQfKqFSPfNCzpIk0Ca7Rtjfzqd70F7XpVh1fAb/6ihdziM4pwcozPRB7PVT4DAvyJDeoLzjKMI7+G22DmrVWLCwuWalUOijeIyqQFX/Mue/oLKBhzv437UPiZ3ugV3MXOXL5xOXSHRPf8SZnOlkgQVyNxrJPlZPO2fqzoujMf4YjD7kLAthqlZVGF5sYqVIeqB+4UCUumMQh13UA7ASOdzYjpMc2/NpDmH4zJ5HmV2mNB7creVTaGwesR/8RRFAmcJwj/uUT7qjVzZWC8f92LAJsIHvJjRFjqCJGDySwf/fc99XlYEwsQQProqA5yoLf42AYLL2qceaPjxdU+5WKmZIq5fBzo9X5nyqhGJiR7fwjCvXSiQojnHnt/3cmK+t z+16zNYo vtA2M5fxkOBpchzRbfXYaPH+xK3ekxghDo634c2T8xNaG1LQRiL7eABtDcFyvoDB0rTZpE3vQScz0DQlvokuUrWkrXIoZ/ZDvhWjpM1su8zfRCPd/H6JfsZ0t3vDtN7Z/jS7ghr/RBnIqGITXW08YoCCNQXbkhVe77Cra 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 ac1d93d43f2b..3d11c5fb6090 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1567,7 +1567,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); }