Message ID | 20230626171430.3167004-7-ryan.roberts@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7640625vqr; Mon, 26 Jun 2023 10:29:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KdZ/bRVUWYqrOrZ+PF1S1nU77tzFvbWzQ5Nlfv6RCk8HlQIajRi1jrKcYYWktnn9rMUR8 X-Received: by 2002:a17:907:26cb:b0:96f:e5af:ac5f with SMTP id bp11-20020a17090726cb00b0096fe5afac5fmr24727805ejc.47.1687800581782; Mon, 26 Jun 2023 10:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687800581; cv=none; d=google.com; s=arc-20160816; b=hyMb4ZXnndY0pm/rot7xg9TXJxh0MX6EbOyT0f2iCV24Aqouy6di8aIKBH4dPSLTya V50xigXy1XxjxsPyIos9KxgabBw/cd7o339S9d0br1u8nqmFN01uhQ8Jlkg3xZmURVU4 sgqIJt/nPNc9wtR1NnUYPectfky+QzP7oy8i2/5M7LF9aW9Vl7j2thL2XJI0C29TMN06 WpLUcbzHlFvuOMwLpOkxBFJwmoUpU0DCjcu9lC5tkm6Gh0YoHbRbGGX4/nlOKGZ+8tGO +U4cfbzdiISGmTPEhj9Ngs/ch9tQDra+ukd/89aeaiEAtgmN2gh6dJOl+nkGR4MurnD+ /aEQ== 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=9LDnxtcMGKzMwMeO2DGDBjGbhx12txEm8328niFWh5M=; fh=H2MVjBlipHVEN6kEAh1RDhnPLB9jpPNjGExTmo1/EvA=; b=nKA/X7wJ2qAMcdLUxkinRODrg0+l4YBB61gNqZxghnz/dH4Bfp9nd5Zm4K+BHVuoUP Mnj8HmIRxZLpB/egteN6jB8gWkSghhfMoHnHhIyFGa9bCYGPtcVumiCuYfC8JRTIYK8Y avG6yv6EiL75jGHtJoXS0vrUbZnBfLMONPU3xSdF+OEHORxLsLjW3IdiQ09RjLgDcaIW 7Aqh0wZUhuaFQ6+ySSmDevtBsgBBQP0+M8AffjJx29pdRjxWiyGsYXQdHO1aSH/NVaR0 C8jonXZICxNeo81mhiTgYB40Z7znEwgs5naGZp6foQvxJTjKhBQ9m+atYk0st4BJuX2G GGwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gq17-20020a170906e25100b0098e0c0cfb64si2677223ejb.111.2023.06.26.10.29.17; Mon, 26 Jun 2023 10:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjFZRPp (ORCPT <rfc822;filip.gregor98@gmail.com> + 99 others); Mon, 26 Jun 2023 13:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbjFZRPC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Jun 2023 13:15:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C05EB10F5; Mon, 26 Jun 2023 10:14:59 -0700 (PDT) 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 <ryan.roberts@arm.com> To: Andrew Morton <akpm@linux-foundation.org>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Yin Fengwei <fengwei.yin@intel.com>, David Hildenbrand <david@redhat.com>, Yu Zhao <yuzhao@google.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Cc: Ryan Roberts <ryan.roberts@arm.com>, 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 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769787183194393377?= X-GMAIL-MSGID: =?utf-8?q?1769787183194393377?= |
Series |
variable-order, large folios for anonymous memory
|
|
Commit Message
Ryan Roberts
June 26, 2023, 5:14 p.m. UTC
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 <ryan.roberts@arm.com>
---
mm/rmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jun 26, 2023 at 11:15 AM Ryan Roberts <ryan.roberts@arm.com> wrote: > > 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 <ryan.roberts@arm.com> Reviewed-by: Yu Zhao <yuzhao@google.com>
On 6/27/23 01:14, Ryan Roberts wrote: > 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 <ryan.roberts@arm.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Regards 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); > }
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); }