Message ID | 20231122162950.3854897-2-ryan.roberts@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1449769vqb; Wed, 22 Nov 2023 08:33:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfYf4fW2qYl/3OgwVXMykkOCoBw0UOiQJbujGdMPyQWDW6TN4a0rHwpVNUX1QHcLgtR3Gr X-Received: by 2002:a05:6a00:21c9:b0:690:41a1:9b6a with SMTP id t9-20020a056a0021c900b0069041a19b6amr3005386pfj.5.1700670799104; 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=vmxQ3ff4wtJW187rG3wK36roep3b6j6AeAR/6jizroTuOlpl0VyB7cGzQZ3FHut/B8 fO2Rxf1W4l12/xlJT/65AU133A6KnHOq01LckGv0bUB3lqqyKhx5gp04w014Xums8LEQ gkl9wT0HZ73nIX6mf8RIVP8zE5Swi18yWj2SNQojtA6HZKSXMfjqIYMKhk0WRab+Abfk VajBlkHKox3JrP6Qb1WbtFl5hqs9LaHgIZJ9bsNz4/bLsx9qNYDRX0tgeMLLXqD5HxFt 8VL45RhmqZAraUk6jqDtojyCDXCmUBIs6nPBRVaecez7xkch5z2zliFm8++KTCCG5MlL kuiA== 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 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e6-20020a63d946000000b00585463c36fbsi12877754pgj.44.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 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 E142380658F6; Wed, 22 Nov 2023 08:30:19 -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 <rfc822;ouuuleilei@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <ryan.roberts@arm.com> To: Andrew Morton <akpm@linux-foundation.org>, Matthew Wilcox <willy@infradead.org>, Yin Fengwei <fengwei.yin@intel.com>, David Hildenbrand <david@redhat.com>, Yu Zhao <yuzhao@google.com>, Catalin Marinas <catalin.marinas@arm.com>, Anshuman Khandual <anshuman.khandual@arm.com>, Yang Shi <shy828301@gmail.com>, "Huang, Ying" <ying.huang@intel.com>, Zi Yan <ziy@nvidia.com>, Luis Chamberlain <mcgrof@kernel.org>, Itaru Kitayama <itaru.kitayama@gmail.com>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, John Hubbard <jhubbard@nvidia.com>, David Rientjes <rientjes@google.com>, Vlastimil Babka <vbabka@suse.cz>, Hugh Dickins <hughd@google.com>, Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Ryan Roberts <ryan.roberts@arm.com>, 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: <linux-kernel.vger.kernel.org> 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:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783282583656814462 X-GMAIL-MSGID: 1783282583656814462 |
Series |
Small-sized THP for anonymous memory
|
|
Commit Message
Ryan Roberts
Nov. 22, 2023, 4:29 p.m. UTC
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 <yuzhao@google.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com> --- mm/rmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1
Comments
> 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 <yuzhao@google.com> > Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> > Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Reviewed-by: David Hildenbrand <david@redhat.com> > Signed-off-by: Ryan Roberts <ryan.roberts@arm.com> > --- Reviewed-by: Barry Song <v-songbaohua@oppo.com> > 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 Thanks Barry
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); }