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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D428C433EF for ; Mon, 4 Apr 2022 09:05:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC0126B007B; Mon, 4 Apr 2022 05:04:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D48DA6B007D; Mon, 4 Apr 2022 05:04:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE8C76B007E; Mon, 4 Apr 2022 05:04:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id A9F796B007B for ; Mon, 4 Apr 2022 05:04:59 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 674661837DCBE for ; Mon, 4 Apr 2022 09:04:49 +0000 (UTC) X-FDA: 79318611498.25.38586FB Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf19.hostedemail.com (Postfix) with ESMTP id 985FE1A0007 for ; Mon, 4 Apr 2022 09:04:48 +0000 (UTC) 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 A66521FB; Mon, 4 Apr 2022 02:04:47 -0700 (PDT) Received: from [10.163.37.159] (unknown [10.163.37.159]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 02B453F718; Mon, 4 Apr 2022 02:04:41 -0700 (PDT) Message-ID: Date: Mon, 4 Apr 2022 14:35:08 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP Content-Language: en-US To: Muchun Song , will@kernel.org, akpm@linux-foundation.org, david@redhat.com, bodeddub@amazon.com, osalvador@suse.de, mike.kravetz@oracle.com, rientjes@google.com, mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, 21cnbao@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com References: <20220331065640.5777-1-songmuchun@bytedance.com> From: Anshuman Khandual In-Reply-To: <20220331065640.5777-1-songmuchun@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 985FE1A0007 X-Stat-Signature: 3nfa611787ft5e96jgm4zhseopx1qzjk X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf19.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-HE-Tag: 1649063088-625972 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: On 3/31/22 12:26, Muchun Song wrote: > The feature of minimizing overhead of struct page associated with each > HugeTLB page is implemented on x86_64, however, the infrastructure of > this feature is already there, we could easily enable it for other > architectures. Introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP for other > architectures to be easily enabled. Just select this config if they > want to enable this feature. > > Suggested-by: Andrew Morton > Signed-off-by: Muchun Song > --- > arch/x86/Kconfig | 1 + > fs/Kconfig | 10 +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 9f5bd41bf660..e69d42528542 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -119,6 +119,7 @@ config X86 > select ARCH_WANTS_DYNAMIC_TASK_STRUCT > select ARCH_WANTS_NO_INSTR > select ARCH_WANT_HUGE_PMD_SHARE > + select ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP if X86_64 > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_THP_SWAP if X86_64 > select ARCH_HAS_PARANOID_L1D_FLUSH > diff --git a/fs/Kconfig b/fs/Kconfig > index 6c7dc1387beb..f6db2af33738 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -245,9 +245,17 @@ config HUGETLBFS > config HUGETLB_PAGE > def_bool HUGETLBFS > > +# > +# Select this config option from the architecture Kconfig, if it is preferred > +# to enable the feature of minimizing overhead of struct page associated with > +# each HugeTLB page. > +# > +config ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > + bool > + > config HUGETLB_PAGE_FREE_VMEMMAP > def_bool HUGETLB_PAGE > - depends on X86_64 > + depends on ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > depends on SPARSEMEM_VMEMMAP > > config HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON Better to have platforms subscribe via ARCH_HAS/WANTS_ method instead of direct dependency in the config itself. LGTM. Reviewed-by: Anshuman Khandual