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 981ECC433EF for ; Thu, 31 Mar 2022 08:49:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24F956B0072; Thu, 31 Mar 2022 04:49:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FCFA6B0073; Thu, 31 Mar 2022 04:49:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C52E6B0074; Thu, 31 Mar 2022 04:49:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id F0E4F6B0072 for ; Thu, 31 Mar 2022 04:49:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BE8982316D for ; Thu, 31 Mar 2022 08:49:12 +0000 (UTC) X-FDA: 79304056944.04.7D49BCA Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) by imf22.hostedemail.com (Postfix) with ESMTP id 6751FC001D for ; Thu, 31 Mar 2022 08:49:10 +0000 (UTC) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-2e6650cde1bso245742757b3.12 for ; Thu, 31 Mar 2022 01:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wZXg0Wk9U3eMPQQ4UazcTOVg50FT5PR+ms1Rv/O8uCA=; b=hF8NFikAHise1/tYewXzZvTJNTN9TjGoI3aMW6OzvdRwNeEZei9fo2XJCfe+N+eV5J QYyirxTyzU/AHFDAB2oXhusj7nlJeC9WtbOY0E5WwWtN35FrEmd2wZl3JkfxaBSvqC9E yS+dM4NKYp57Srqgrf507Y+NfpGcIJHrwHDf+IVXPnWD/xCrJ/gucYOSY9tqNcm5oAks Z3dD2MFzKoWjExJo1bGI/gwSW9jxwmrBjEfyf2k3m0aEvTDawuYPOtyB/9c0Es6SHc/X 0EqGP3kd7m4gLOqnmz2l/Ji/090Dh9eDQIZ5Cat40Pjg140u18LgOjAx75AyavvkKUAg 7anw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZXg0Wk9U3eMPQQ4UazcTOVg50FT5PR+ms1Rv/O8uCA=; b=DaA/k8X0vvrVIMfxDP4z9p/rWVYr0tR9HTAm0HC1UMKIgwWUl93qtwJU6EKN/0SnYJ AeMafJRaK5xm7B7caKNWb76YKf1brEvT6uxsxyClvicSZ29BmFNlyu9dFOyhY9B5kGEB UbnuNQ2YoRLmxA6KFLiU4h9Np2IPudrRnNzrK+Pby9ul6ksJWojimLShkhJpVysXAPO7 Xpq03EmnYNN5UMy9Qii9mrNOI+vhFV4GodhyiFula1u0esqKKzha8ZnpvCVr4CG44Y4H YVDKt5heI9v4QJ/EhuxN27526+JEKZRdXJJNZ0Jta8d714vSitK/MIpo5Uf1KBNf9TDm 63aA== X-Gm-Message-State: AOAM5324NsFKCKaTJenqw9N6Sv2aj8jRZ2VDxxoNF5lMlxI7PMFcBfsX brHxNrjh451Zk3O7rf4IwqTkP1pq3rhRmh32bfQjGA== X-Google-Smtp-Source: ABdhPJyvfTSa45LVThNTL1ozkOHEy9or+BjMwghda/8khUheyPrr89Rwl6DGXpWdcL77w/7pBLQ0L5ZwByBn8dKTGwk= X-Received: by 2002:a0d:ccca:0:b0:2e6:2b53:3f16 with SMTP id o193-20020a0dccca000000b002e62b533f16mr4098014ywd.35.1648716549512; Thu, 31 Mar 2022 01:49:09 -0700 (PDT) MIME-Version: 1.0 References: <20220331065640.5777-1-songmuchun@bytedance.com> <6c774e27-26d2-6c45-65f9-8a5b8acd6433@redhat.com> In-Reply-To: <6c774e27-26d2-6c45-65f9-8a5b8acd6433@redhat.com> From: Muchun Song Date: Thu, 31 Mar 2022 16:48:33 +0800 Message-ID: Subject: Re: [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP To: David Hildenbrand Cc: Will Deacon , Andrew Morton , "Bodeddula, Balasubramaniam" , Oscar Salvador , Mike Kravetz , David Rientjes , Mark Rutland , Catalin Marinas , james.morse@arm.com, Barry Song <21cnbao@gmail.com>, LAK , LKML , Linux Memory Management List , Xiongchun duan , Fam Zheng , Muchun Song Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6751FC001D X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=hF8NFikA; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.128.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: h7r9oxms548bwzf9js1g7i6iijk5jrgq X-HE-Tag: 1648716550-484595 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 Thu, Mar 31, 2022 at 4:42 PM David Hildenbrand wrote: > > On 31.03.22 08:56, 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 > > > I think something like "HUGETLB_OPTIMIZE_VMEMMAP" might be more > expressive, but that would imply renaming the existing config knob. > How about doing a full code cleanup in a separate series in the future?