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 1E184C433F5 for ; Thu, 31 Mar 2022 08:54:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5DF76B0072; Thu, 31 Mar 2022 04:54:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E6C46B0074; Thu, 31 Mar 2022 04:54:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 886B76B0075; Thu, 31 Mar 2022 04:54:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 7B2316B0072 for ; Thu, 31 Mar 2022 04:54:26 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 297D2182AF1ED for ; Thu, 31 Mar 2022 08:54:26 +0000 (UTC) X-FDA: 79304070132.28.8058B0C Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf21.hostedemail.com (Postfix) with ESMTP id BFB101C000C for ; Thu, 31 Mar 2022 08:54:25 +0000 (UTC) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-2e64a6b20eeso246585667b3.3 for ; Thu, 31 Mar 2022 01:54:25 -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=Xn8azzFhzPhyLx+cU3W3Fc2v8I4Cjd0IkMQ9uqr47o8=; b=5vtJ2thFavd9cLivjIt3UYcmVVHdyG8sUhR6t4y9k09OG/HquF9FJUQEWh12OMpeCd 8QZWJP2cIWOpXHZVjwUAWn3b+rZNye1bM3f3hsfjxx/HwsdrZEk7ZSFeSHZPBsFYiPBF V5q91UAat/yBLYIr5qLMFKO7RrzV1PcOW57tDQS7GangAFjkcqnqv3RXl6Z1Hcxw1R0g SXpZDRNAaIRvtNg4RFoA7lbpVwLoZjZmkZg36nea/VMZa4MytSYGtolbRSukFadOMslq WtyF+R19LohMwn2b4IPdNNojqBiELaXz8cfmxjhUfkUVgHkZEztwtTjiYdQ3rxOGEDi8 ctNA== 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=Xn8azzFhzPhyLx+cU3W3Fc2v8I4Cjd0IkMQ9uqr47o8=; b=e08LEOVD3rc44jpDXevYfB4AuljXAcTWAtxWxXyZZG/ZcHuGXXKwr1di/Ef2DxYKNQ h9f5YoBcTEwumBVC9Gp5ybzxu88obkfkeMDcksUABL1FrnW0LMB+rnPxusY3mfXBPN0Z TAY0znggwWJznN/LnqCfzdhn8qMMuEQi8HU5gcddcp89v0JXCEr5C0N8fe2iwIJcaSM5 6dYA1qhDf25ykJCiir10eI66llNRkZTdbkX8UOU+A+1E8VBmLi/w+DfQJYbwekxGOo2f 9iMdvBmrXYeTYout9bpF18enAAzVdrZ9SATC+tG4RI/cxIEdayTw8kYnCumkA2YipoiK QTuQ== X-Gm-Message-State: AOAM531vXpxfDPJk8esMqn8SGtsxmruf2WLukuujznr4kELD/Xq3On3M TwgtHRRIYxpCuy5n+QRb2s02YyKZxW2nZNTdP/gjncqNaR4= X-Google-Smtp-Source: ABdhPJxw6+paO/ULlF+r7RmJCKQmMCdHrJH4j9IS297GY/P3ppySDM2E+Tmp5keTQENtNboxL9+OZGX99Bm3WL+EJSk= X-Received: by 2002:a81:1c4f:0:b0:2e5:9db3:7a8e with SMTP id c76-20020a811c4f000000b002e59db37a8emr3679214ywc.319.1648716864751; Thu, 31 Mar 2022 01:54:24 -0700 (PDT) MIME-Version: 1.0 References: <20220331065640.5777-1-songmuchun@bytedance.com> <6c774e27-26d2-6c45-65f9-8a5b8acd6433@redhat.com> <445c5426-cfb6-0232-6ea5-41cf8aaa264e@redhat.com> In-Reply-To: <445c5426-cfb6-0232-6ea5-41cf8aaa264e@redhat.com> From: Muchun Song Date: Thu, 31 Mar 2022 16:53:48 +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 , 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-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5vtJ2thF; spf=pass (imf21.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BFB101C000C X-Stat-Signature: udydtgkspeb5nyt699abizzmxo4yjxfx X-HE-Tag: 1648716865-938505 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:51 PM David Hildenbrand wrote: > > On 31.03.22 10:48, Muchun Song wrote: > > 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? > > > > Yeah. > OK. Have Added it into my To-do list. Thanks.