From patchwork Fri Apr 14 13:02:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13211459 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 B3DB6C77B6E for ; Fri, 14 Apr 2023 13:03:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 403D2900003; Fri, 14 Apr 2023 09:03:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33E33900002; Fri, 14 Apr 2023 09:03:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B8A9900003; Fri, 14 Apr 2023 09:03:30 -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 05176900002 for ; Fri, 14 Apr 2023 09:03:30 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9C2A5A01AA for ; Fri, 14 Apr 2023 13:03:29 +0000 (UTC) X-FDA: 80680012938.07.C0852A5 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id DCAED1C0036 for ; Fri, 14 Apr 2023 13:03:27 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681477408; 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=Mh/TNobpjhPFBv0BoO7O3iGqtKsxocuKJbzqF9rn0lM=; b=EojlzwE+j68PS18GZ7kuBIYnLb02uEfOMuVNLk+O8jU8WuJDTGzkXsxPMJSK6O5ksHmqNA ZqnYCwwpHMDbUkx8EXfJgp0Cqo6/iaEo80Qv1V7I/EBkBBMrDiNWmCSOq22P76ZKi1/zfB TApNQW9oGaO9bA+gja+CjuyPkiM9cio= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681477408; a=rsa-sha256; cv=none; b=lR6OkEAkKVIxK8+yUKrUxTVM5PgRobMPgoMzkxrVYsmuP+MQb4/CSXAdZjCBejgXT2T2UA qw9pNy57d0crbtfURL+XHMjspIMMLnG/irfhPNOPDT6p7a9KCuGhB0Mb4J5ToGZp2YrE4R XPfTIr3N5By8RWUvr/CGiHPYTLvAY3Q= 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 15934175D; Fri, 14 Apr 2023 06:04:12 -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 911753F6C4; Fri, 14 Apr 2023 06:03:26 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , "Matthew Wilcox (Oracle)" , Yu Zhao , "Yin, Fengwei" Cc: Ryan Roberts , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: [RFC v2 PATCH 07/17] mm: Allow deferred splitting of arbitrary large anon folios Date: Fri, 14 Apr 2023 14:02:53 +0100 Message-Id: <20230414130303.2345383-8-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230414130303.2345383-1-ryan.roberts@arm.com> References: <20230414130303.2345383-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: x1jj3wegnow6eutacfw8sumodn8ekhpw X-Rspamd-Queue-Id: DCAED1C0036 X-HE-Tag: 1681477407-434135 X-HE-Meta: U2FsdGVkX1+rd4KHSjVnGVwmyOX4e6fTbgabUv3TTxYrvcYnwdUI0fUsweIcI/VHAhhb2Qr4hjjvX7kAfV6DhfnX3IXPk2Wkfd9Hmg80SOhLPQqAJTqmDoUX3a2k95Cj9/pTyFrdpQQ5ziC663599VNB/hdkafrH+gDkAByFX6mABwBiu7eSaWP3gO3LPHLQqsFBwwtBvNMopDFa+2l5450ViN4VZFlOV7S012YCsg5f7zgGnSZkYr2fHhxgkw4NwjElCQ69C1710AkU5e5Gb2WZD7R+2mS5Ej1E68Q8IXabKms0BwIf5Q4YdahWWCr1tEHygPJN82S3Y/juuQ8WZL4z7ciAe7LHLNhGxqTB2uRcZG66i76srKCaOWLq86VGSioqMrtDQu/l/ZNf8ritdP87ZKy1KLiTDEKc59CXBYyI1vI5xZy/jNNFKfqsTrWBlbP1GOLd+aaz78lyJtbb28l1PgZWI4+bh9gbEjp+mQHCo4oPJM5pPzkD5AoHiZ3+9xemye8gfNcvkM4x+XJECAqKKzmMGqdgU9+CoqzIQe/7WrIMPQNi3sxLcyampIPYbrNqwV20m2iTE/2jD3xKfkLKfaF4TD54DXWU3A3z/vsbymEtX4Oc2KW9yE8jwAQ4Z0oWcPT1koShLuCkjuY8QGyae01HAZEjH/voVPZqVPA1fVLnd1FFekyR3xwgTCKU71TmMh1q6sJaFv6tKAZXLNHL8rsD3dwqRoIzc9l/raTwWMRMJvw2b4iDMinI/RA1t9e7b37mIf5o+3cK2c0uZcm9q3HiTZI6ld+aQ/PZpEGhzUSJppt63mj4y/7Lmb5npKP9abz2ziUw2QetDTsgPAMKeML2r3zNH7fO+b75WrXHJCw6hlfedS3ll69g7goxn49FhrHSQbnU9UwET9H3KcgbSMSc774Q+YvCquRmjiSqpi/gfgo+AURcadFnF0WdnIeGoNw1OwElMlrO4Mr 4DceoEzN t3DtgV/6jhz1Q7lNrtqVCWYSlZe9gIO4L0FbDhGVUnI6IdaLarId32gJqkKB4Wbn6A6Z6a+tsqu986aT9FqiRgCAW0xdGlBsj6t5yJJzeMkBGxQNbmj3yGc+lxi95UgVdgsRXz8zS14zfTgWyEY8jEEbzk7oNR2e1SgQ9SKGk4l+6mOs= 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 --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/mm/rmap.c b/mm/rmap.c index d563d979c005..5148a484f915 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1470,7 +1470,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); }