From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Roberts Subject: Re: [PATCH v1 08/10] mm: Kconfig hooks to determine max anon folio allocation order Date: Thu, 29 Jun 2023 12:31:52 +0100 Message-ID: <09ef8f66-6697-d803-89ac-228a6fe2e604@arm.com> References: <20230626171430.3167004-1-ryan.roberts@arm.com> <20230626171430.3167004-9-ryan.roberts@arm.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-ID: Content-Type: text/plain; charset="windows-1252" To: Yang Shi Cc: 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" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger On 29/06/2023 02:38, Yang Shi wrote: > On Mon, Jun 26, 2023 at 10:15=E2=80=AFAM Ryan Roberts wrote: >> >> For variable-order anonymous folios, we need to determine the order that >> we will allocate. From a SW perspective, the higher the order we >> allocate, the less overhead we will have; fewer faults, fewer folios in >> lists, etc. But of course there will also be more memory wastage as the >> order increases. >> >> From a HW perspective, there are memory block sizes that can be >> beneficial to reducing TLB pressure. arm64, for example, has the ability >> to map "contpte" sized chunks (64K for a 4K base page, 2M for 16K and >> 64K base pages) such that one of these chunks only uses a single TLB >> entry. >> >> So we let the architecture specify the order of the maximally beneficial >> mapping unit when PTE-mapped. Furthermore, because in some cases, this >> order may be quite big (and therefore potentially wasteful of memory), >> allow the arch to specify 2 values; One is the max order for a mapping >> that _would not_ use THP if all size and alignment constraints were met, >> and the other is the max order for a mapping that _would_ use THP if all >> those constraints were met. >> >> Implement this with Kconfig by introducing some new options to allow the >> architecture to declare that it supports large anonymous folios along >> with these 2 preferred max order values. Then introduce a user-facing >> option, LARGE_ANON_FOLIO, which defaults to disabled and can only be >> enabled if the architecture has declared its support. When disabled, it >> forces the max order values, LARGE_ANON_FOLIO_NOTHP_ORDER_MAX and >> LARGE_ANON_FOLIO_THP_ORDER_MAX to 0, meaning only a single page is ever >> allocated. >> >> Signed-off-by: Ryan Roberts >> --- >> mm/Kconfig | 39 +++++++++++++++++++++++++++++++++++++++ >> mm/memory.c | 8 ++++++++ >> 2 files changed, 47 insertions(+) >> >> diff --git a/mm/Kconfig b/mm/Kconfig >> index 7672a22647b4..f4ba48c37b75 100644 >> --- a/mm/Kconfig >> +++ b/mm/Kconfig >> @@ -1208,4 +1208,43 @@ config PER_VMA_LOCK >> >> source "mm/damon/Kconfig" >> >> +config ARCH_SUPPORTS_LARGE_ANON_FOLIO >> + def_bool n >> + help >> + An arch should select this symbol if wants to allow LARGE_ANON= _FOLIO >> + to be enabled. It must also set the following integer values: >> + - ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + - ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + >> +config ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + int >> + help >> + The maximum size of folio to allocate for an anonymous VMA PTE= -mapping >> + that does not have the MADV_HUGEPAGE hint set. >> + >> +config ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + int >> + help >> + The maximum size of folio to allocate for an anonymous VMA PTE= -mapping >> + that has the MADV_HUGEPAGE hint set. >> + >> +config LARGE_ANON_FOLIO >> + bool "Allocate large folios for anonymous memory" >> + depends on ARCH_SUPPORTS_LARGE_ANON_FOLIO >> + default n >> + help >> + Use large (bigger than order-0) folios to back anonymous memor= y where >> + possible. This reduces the number of page faults, as well as o= ther >> + per-page overheads to improve performance for many workloads. >> + >> +config LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + int >> + default 0 if !LARGE_ANON_FOLIO >> + default ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + >> +config LARGE_ANON_FOLIO_THP_ORDER_MAX >> + int >> + default 0 if !LARGE_ANON_FOLIO >> + default ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + >=20 > IMHO I don't think we need all of the new kconfigs. Ideally the large > anon folios could be supported by all arches, although some of them > may not benefit from larger TLB entries due to lack of hardware > support.t >=20 > For now with a minimum implementation, I think you could define a > macro or a function that returns the hardware preferred order. Thanks for the feedback - that aligns with what Yu Zhao suggested. I'm implementing it for v2. Thanks, Ryan >=20 >> endmenu >> diff --git a/mm/memory.c b/mm/memory.c >> index 9165ed1b9fc2..a8f7e2b28d7a 100644 >> --- a/mm/memory.c >> +++ b/mm/memory.c >> @@ -3153,6 +3153,14 @@ static struct folio *try_vma_alloc_movable_folio(= struct vm_area_struct *vma, >> return vma_alloc_movable_folio(vma, vaddr, 0, zeroed); >> } >> >> +static inline int max_anon_folio_order(struct vm_area_struct *vma) >> +{ >> + if (hugepage_vma_check(vma, vma->vm_flags, false, true, true)) >> + return CONFIG_LARGE_ANON_FOLIO_THP_ORDER_MAX; >> + else >> + return CONFIG_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX; >> +} >> + >> /* >> * Handle write page faults for pages that can be reused in the current= vma >> * >> -- >> 2.25.1 >> >> From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02386C001B3 for ; Thu, 29 Jun 2023 11:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231537AbjF2Lb7 (ORCPT ); Thu, 29 Jun 2023 07:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjF2Lb6 (ORCPT ); Thu, 29 Jun 2023 07:31:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 714C8132; Thu, 29 Jun 2023 04:31:56 -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 C511DC14; Thu, 29 Jun 2023 04:32:39 -0700 (PDT) Received: from [10.1.27.40] (C02Z41KALVDN.cambridge.arm.com [10.1.27.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45CFC3F64C; Thu, 29 Jun 2023 04:31:53 -0700 (PDT) Message-ID: <09ef8f66-6697-d803-89ac-228a6fe2e604@arm.com> Date: Thu, 29 Jun 2023 12:31:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v1 08/10] mm: Kconfig hooks to determine max anon folio allocation order To: Yang Shi Cc: 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" , 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 References: <20230626171430.3167004-1-ryan.roberts@arm.com> <20230626171430.3167004-9-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ia64@vger.kernel.org On 29/06/2023 02:38, Yang Shi wrote: > On Mon, Jun 26, 2023 at 10:15 AM Ryan Roberts wrote: >> >> For variable-order anonymous folios, we need to determine the order that >> we will allocate. From a SW perspective, the higher the order we >> allocate, the less overhead we will have; fewer faults, fewer folios in >> lists, etc. But of course there will also be more memory wastage as the >> order increases. >> >> From a HW perspective, there are memory block sizes that can be >> beneficial to reducing TLB pressure. arm64, for example, has the ability >> to map "contpte" sized chunks (64K for a 4K base page, 2M for 16K and >> 64K base pages) such that one of these chunks only uses a single TLB >> entry. >> >> So we let the architecture specify the order of the maximally beneficial >> mapping unit when PTE-mapped. Furthermore, because in some cases, this >> order may be quite big (and therefore potentially wasteful of memory), >> allow the arch to specify 2 values; One is the max order for a mapping >> that _would not_ use THP if all size and alignment constraints were met, >> and the other is the max order for a mapping that _would_ use THP if all >> those constraints were met. >> >> Implement this with Kconfig by introducing some new options to allow the >> architecture to declare that it supports large anonymous folios along >> with these 2 preferred max order values. Then introduce a user-facing >> option, LARGE_ANON_FOLIO, which defaults to disabled and can only be >> enabled if the architecture has declared its support. When disabled, it >> forces the max order values, LARGE_ANON_FOLIO_NOTHP_ORDER_MAX and >> LARGE_ANON_FOLIO_THP_ORDER_MAX to 0, meaning only a single page is ever >> allocated. >> >> Signed-off-by: Ryan Roberts >> --- >> mm/Kconfig | 39 +++++++++++++++++++++++++++++++++++++++ >> mm/memory.c | 8 ++++++++ >> 2 files changed, 47 insertions(+) >> >> diff --git a/mm/Kconfig b/mm/Kconfig >> index 7672a22647b4..f4ba48c37b75 100644 >> --- a/mm/Kconfig >> +++ b/mm/Kconfig >> @@ -1208,4 +1208,43 @@ config PER_VMA_LOCK >> >> source "mm/damon/Kconfig" >> >> +config ARCH_SUPPORTS_LARGE_ANON_FOLIO >> + def_bool n >> + help >> + An arch should select this symbol if wants to allow LARGE_ANON_FOLIO >> + to be enabled. It must also set the following integer values: >> + - ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + - ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + >> +config ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + int >> + help >> + The maximum size of folio to allocate for an anonymous VMA PTE-mapping >> + that does not have the MADV_HUGEPAGE hint set. >> + >> +config ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + int >> + help >> + The maximum size of folio to allocate for an anonymous VMA PTE-mapping >> + that has the MADV_HUGEPAGE hint set. >> + >> +config LARGE_ANON_FOLIO >> + bool "Allocate large folios for anonymous memory" >> + depends on ARCH_SUPPORTS_LARGE_ANON_FOLIO >> + default n >> + help >> + Use large (bigger than order-0) folios to back anonymous memory where >> + possible. This reduces the number of page faults, as well as other >> + per-page overheads to improve performance for many workloads. >> + >> +config LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + int >> + default 0 if !LARGE_ANON_FOLIO >> + default ARCH_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX >> + >> +config LARGE_ANON_FOLIO_THP_ORDER_MAX >> + int >> + default 0 if !LARGE_ANON_FOLIO >> + default ARCH_LARGE_ANON_FOLIO_THP_ORDER_MAX >> + > > IMHO I don't think we need all of the new kconfigs. Ideally the large > anon folios could be supported by all arches, although some of them > may not benefit from larger TLB entries due to lack of hardware > support.t > > For now with a minimum implementation, I think you could define a > macro or a function that returns the hardware preferred order. Thanks for the feedback - that aligns with what Yu Zhao suggested. I'm implementing it for v2. Thanks, Ryan > >> endmenu >> diff --git a/mm/memory.c b/mm/memory.c >> index 9165ed1b9fc2..a8f7e2b28d7a 100644 >> --- a/mm/memory.c >> +++ b/mm/memory.c >> @@ -3153,6 +3153,14 @@ static struct folio *try_vma_alloc_movable_folio(struct vm_area_struct *vma, >> return vma_alloc_movable_folio(vma, vaddr, 0, zeroed); >> } >> >> +static inline int max_anon_folio_order(struct vm_area_struct *vma) >> +{ >> + if (hugepage_vma_check(vma, vma->vm_flags, false, true, true)) >> + return CONFIG_LARGE_ANON_FOLIO_THP_ORDER_MAX; >> + else >> + return CONFIG_LARGE_ANON_FOLIO_NOTHP_ORDER_MAX; >> +} >> + >> /* >> * Handle write page faults for pages that can be reused in the current vma >> * >> -- >> 2.25.1 >> >> From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1043EB64D9 for ; Thu, 29 Jun 2023 11:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9F0iCoVER/EJYBrouU6+y0seFE2/eorxw1crDrUJe6s=; b=uor/IsDLYPCGz9 3EcbCEqTzLOGLc1FJqWSBISv90vQI2q3xcSs4c7Aob8+1+4fF4pO5nBwniIrpyaXku5cO+GNlPXDi mzwTXhWm79ngPURLUffArL6Wj5HSaetywQ/qVw3KTlaDlbVZw5lN0jB/Iv5Rx4J6x9pm5aQIRFUGH HDAWlGhJKX7sLhemYtxHokC5IfwGyy8N5IcBQ1KZapDgyNm2PI6Qr1+dPAo8RCMQudaRsc/i3NWYf tDuZrmtJkiGnTZAQLzpz1Bav9/CFighxDoHedbvxvMvnTZuFr/VP7jMAa3al0SncfsvPTZHhu8PHo 39+fS5K9QhZtJqNyLZVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEpsX-000xfs-1a; Thu, 29 Jun 2023 11:32:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEpsU-000xeb-1k for linux-arm-kernel@lists.infradead.org; Thu, 29 Jun 2023 11:32:00 +0000 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 C511DC14; Thu, 29 Jun 2023 04:32:39 -0700 (PDT) Received: from [10.1.27.40] (C02Z41KALVDN.cambridge.arm.com [10.1.27.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45CFC3F64C; Thu, 29 Jun 2023 04:31:53 -0700 (PDT) Message-ID: <09ef8f66-6697-d803-89ac-228a6fe2e604@arm.com> Date: Thu, 29 Jun 2023 12:31:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v1 08/10] mm: Kconfig hooks to determine max anon folio allocation order To: Yang Shi Cc: 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" , 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 References: <20230626171430.3167004-1-ryan.roberts@arm.com> <20230626171430.3167004-9-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_043158_673907_733DAC01 X-CRM114-Status: GOOD ( 24.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gMjkvMDYvMjAyMyAwMjozOCwgWWFuZyBTaGkgd3JvdGU6Cj4gT24gTW9uLCBKdW4gMjYsIDIw MjMgYXQgMTA6MTXigK9BTSBSeWFuIFJvYmVydHMgPHJ5YW4ucm9iZXJ0c0Bhcm0uY29tPiB3cm90 ZToKPj4KPj4gRm9yIHZhcmlhYmxlLW9yZGVyIGFub255bW91cyBmb2xpb3MsIHdlIG5lZWQgdG8g ZGV0ZXJtaW5lIHRoZSBvcmRlciB0aGF0Cj4+IHdlIHdpbGwgYWxsb2NhdGUuIEZyb20gYSBTVyBw ZXJzcGVjdGl2ZSwgdGhlIGhpZ2hlciB0aGUgb3JkZXIgd2UKPj4gYWxsb2NhdGUsIHRoZSBsZXNz IG92ZXJoZWFkIHdlIHdpbGwgaGF2ZTsgZmV3ZXIgZmF1bHRzLCBmZXdlciBmb2xpb3MgaW4KPj4g bGlzdHMsIGV0Yy4gQnV0IG9mIGNvdXJzZSB0aGVyZSB3aWxsIGFsc28gYmUgbW9yZSBtZW1vcnkg d2FzdGFnZSBhcyB0aGUKPj4gb3JkZXIgaW5jcmVhc2VzLgo+Pgo+PiBGcm9tIGEgSFcgcGVyc3Bl Y3RpdmUsIHRoZXJlIGFyZSBtZW1vcnkgYmxvY2sgc2l6ZXMgdGhhdCBjYW4gYmUKPj4gYmVuZWZp Y2lhbCB0byByZWR1Y2luZyBUTEIgcHJlc3N1cmUuIGFybTY0LCBmb3IgZXhhbXBsZSwgaGFzIHRo ZSBhYmlsaXR5Cj4+IHRvIG1hcCAiY29udHB0ZSIgc2l6ZWQgY2h1bmtzICg2NEsgZm9yIGEgNEsg YmFzZSBwYWdlLCAyTSBmb3IgMTZLIGFuZAo+PiA2NEsgYmFzZSBwYWdlcykgc3VjaCB0aGF0IG9u ZSBvZiB0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