Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp27893rdd; Wed, 22 Nov 2023 08:33:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/EqTb3fJsduIY5Dc5XixLNXVyjcZHY08wGNb70DJpWev6nMO5JcxDgJ/FPXAWq6bn0f1t X-Received: by 2002:a17:90b:4d89:b0:282:d080:feed with SMTP id oj9-20020a17090b4d8900b00282d080feedmr2838289pjb.40.1700670799282; Wed, 22 Nov 2023 08:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700670799; cv=none; d=google.com; s=arc-20160816; b=TpJqEuiYda6o1qKLFLYUaIGpSbLlFdVQNUVFuLWIxyzUDDfKE/SM/UZRctk441xDbl gy/hzGM12FSyIYXTX/+OrV9ZRe0JiUiruTd7Rowojx/q5dIntJHOJZuE+FXdjP6u8fcG V6NXmF4PxUqaMyrI3uv9QhpyDj/cOoYsZs28tUMHjJEaIN+Ct/HV98DErA5mv9Cogz5S XUF+iI3VBI3VUwrrnLUEFDtHesOJlRh/tkzG7Mw0lR/fLKQCMoFSxNT9L4qlVtCYi4OC JwjG0DrxUNsPQcxobPORNJ7XXAdPJvlL0cDjUGyjgpYmV5ADnRauCMOsT7kpZ+tWGkx0 TyzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uLiZitmjG+3foZ1+dsOMU1U8TEvwumUeFwfgKAb7Uhk=; fh=7axEUdnMUApK6aLYLrmxIYzEqwt8JUQTbtI9r8kD7PQ=; b=iyBdciQfMy4diRcs7MvoKbA6UtfeBZVDWHuD1ucu0wSz1c1h3KAt43sn36J4mqh3zg I//2yK5c8oQNLMpBS7RdLiGwB4V6kdFd7Ua+t++ydUp5PtM2thW9ld+vei28YUN9YF8T Vz2PNkgWfewgOVTY+owRsFmjSOdtqkOE4OfTiIHxH42u9MgsbzV9WhjAtr1y2i5v7eFK qrf/YNgn5Xe5UptLVSgcVO26KT8n8cOS7SiFfRfz2kKf7h52T3Jy2xcl6I1A/QNRkOT8 s1jAk/OdZVF1VsNA4iMCcGkUNyEpr27orbNEqErg7cVB4GeV6NDZKLNWZvlKSusbGL6f 5JcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l5-20020a17090a850500b00280979dbb7asi1739986pjn.103.2023.11.22.08.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:33:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4C7CF8065004; Wed, 22 Nov 2023 08:30:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbjKVQaN (ORCPT + 99 others); Wed, 22 Nov 2023 11:30:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230318AbjKVQaM (ORCPT ); Wed, 22 Nov 2023 11:30:12 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2C129A for ; Wed, 22 Nov 2023 08:30:08 -0800 (PST) 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 75A2E1595; Wed, 22 Nov 2023 08:30:55 -0800 (PST) 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 085443F73F; Wed, 22 Nov 2023 08:30:05 -0800 (PST) From: Ryan Roberts To: Andrew Morton , Matthew Wilcox , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , Kefeng Wang Cc: Ryan Roberts , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v7 01/10] mm: Allow deferred splitting of arbitrary anon large folios Date: Wed, 22 Nov 2023 16:29:41 +0000 Message-Id: <20231122162950.3854897-2-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231122162950.3854897-1-ryan.roberts@arm.com> References: <20231122162950.3854897-1-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 08:30:21 -0800 (PST) In preparation for the introduction of anonymous small-sized THP, 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. Reviewed-by: Yu Zhao Reviewed-by: Yin Fengwei Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Signed-off-by: Ryan Roberts --- mm/rmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 7a27a2b41802..49e4d86a4f70 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1488,11 +1488,11 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma, __lruvec_stat_mod_folio(folio, idx, -nr); /* - * Queue anon THP for deferred split if at least one + * Queue anon large folio for deferred split if at least one * 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); } -- 2.25.1