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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63EECC48BE5 for ; Wed, 16 Jun 2021 03:05:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC23361356 for ; Wed, 16 Jun 2021 03:05:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC23361356 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 624436B006C; Tue, 15 Jun 2021 23:05:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D2D46B006E; Tue, 15 Jun 2021 23:05:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44C1E6B0070; Tue, 15 Jun 2021 23:05:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 124DD6B006C for ; Tue, 15 Jun 2021 23:05:18 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A1CA3181AC9BF for ; Wed, 16 Jun 2021 03:05:17 +0000 (UTC) X-FDA: 78258095874.11.29A239C Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf24.hostedemail.com (Postfix) with ESMTP id D6176A0001A9 for ; Wed, 16 Jun 2021 03:05:06 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id bb10-20020a17090b008ab029016eef083425so2706190pjb.5 for ; Tue, 15 Jun 2021 20:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a++J1PMBGBktLaOqH7rcncrGjqzf1ZkNaFZTKcuqOmg=; b=PBDVjpnGeQjL0GbK+kJfVZDwd13zhSVfA+zXL4laYr2r9iV/YeXhChI8tcOzWH1eLa kke1FNxpvG5QB82Sp1sYT1J0AHLWwrHzL/kZXPqbP15rd2ck3zDKZ7r2TLgR/PAchmJv C6XapUnh6QI4SNPiUC6IaCgUgc8jfhmW1l800X5iEOjSjKgji//5ORvyN2TjQI8zVxar fs0pMrb3VaB9SVDDvKAXdRM4zMI2aI+w0fP0DYqBDA12v3vudFOhQF+fXMru/u+EWNdr eRokD9ZQJmgmLDjR0HL1JzUK255+kJUPzSErcLIH1xxQaFGqZclIyRee+VHBWjRMWRBv u9Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a++J1PMBGBktLaOqH7rcncrGjqzf1ZkNaFZTKcuqOmg=; b=SoV/Fj2FhYcnywNGXxkQ3+HjtpoT40XHmHqv6RMvqzxNwOE05p8SVbePYF1xVDZHa2 CrnNFAWHUtuymgRi4J0bupZD1w1zfe/sYoY9YEPBmv1GgifQ5JgrP9X4u9dGh1rdjvvu 5IMVdlHDVjy1feMak8Pr7BJPr+Z4+Y8lJZq4YH04i1/vKgbBuDL9f31nZL5XLeXdXLuh odoAyWzTX2I+/YkdzNkJkh/3AZGJRjGJwUTiuFDYScYzHCE0do1KqFYrxYGanHdkbxGA +ccFobUzRTH7j2I4fze8jVuHRlXX3x61huX0KwjWgQBaMSuYSl3OaVlQHY+o7DfpZaVN tEZQ== X-Gm-Message-State: AOAM533hAqWPyA2IrnghnUZLteyFsfFKjlR7BoLEwTBjCVbxFbxpMjq/ bPldJ51g1SA4a15ze+8b4V0EUuPf0VrJdw8f8baI0Q== X-Google-Smtp-Source: ABdhPJxcrQKBVPmxTPOqvQe15Lg6Siqe8aXWeDtbXRx48e1+OI13Zs12efSGLpfe5LblWFf9O2+3OeSHFlK4JkkyIwM= X-Received: by 2002:a17:90a:10c8:: with SMTP id b8mr8378091pje.147.1623812715259; Tue, 15 Jun 2021 20:05:15 -0700 (PDT) MIME-Version: 1.0 References: <20210612094555.71344-1-songmuchun@bytedance.com> <20210612094555.71344-4-songmuchun@bytedance.com> <3fffaa5e-246e-00bf-5972-54eeb6330a43@oracle.com> In-Reply-To: <3fffaa5e-246e-00bf-5972-54eeb6330a43@oracle.com> From: Muchun Song Date: Wed, 16 Jun 2021 11:04:37 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v2 3/3] mm: hugetlb: introduce CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON To: Joao Martins Cc: Xiongchun duan , fam.zheng@bytedance.com, linux-doc@vger.kernel.org, LKML , Linux Memory Management List , Mike Kravetz , Chen Huang , Andrew Morton , Oscar Salvador , Michal Hocko , "Song Bao Hua (Barry Song)" , David Hildenbrand , Jonathan Corbet , "Bodeddula, Balasubramaniam" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D6176A0001A9 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=PBDVjpnG; spf=pass (imf24.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: a5fkwqn8bgtb1qdzhdeqcp6jqw3to56y X-HE-Tag: 1623812706-677270 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 Wed, Jun 16, 2021 at 7:01 AM Joao Martins wrote: > > > > On 6/12/21 10:45 AM, Muchun Song wrote: > > When using HUGETLB_PAGE_FREE_VMEMMAP, the freeing unused vmemmap pages > > associated with each HugeTLB page is default off. Now the vmemmap is PMD > > mapped. So there is no side effect when this feature is enabled with no > > HugeTLB pages in the system. Someone may want to enable this feature in > > the compiler time instead of using boot command line. So add a config to > > make it default on when someone do not want to enable it via command line. > > > > Signed-off-by: Muchun Song > > --- > > Documentation/admin-guide/kernel-parameters.txt | 3 +++ > > fs/Kconfig | 10 ++++++++++ > > mm/hugetlb_vmemmap.c | 6 ++++-- > > 3 files changed, 17 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > > index a01aadafee38..8eee439d943c 100644 > > --- a/Documentation/admin-guide/kernel-parameters.txt > > +++ b/Documentation/admin-guide/kernel-parameters.txt > > @@ -1604,6 +1604,9 @@ > > on: enable the feature > > off: disable the feature > > > > + Built with CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON=y, > > + the default is on. > > + > > This is not compatible with memory_hotplug.memmap_on_memory. > > If both parameters are enabled, hugetlb_free_vmemmap takes > > precedence over memory_hotplug.memmap_on_memory. > > diff --git a/fs/Kconfig b/fs/Kconfig > > index f40b5b98f7ba..e78bc5daf7b0 100644 > > --- a/fs/Kconfig > > +++ b/fs/Kconfig > > @@ -245,6 +245,16 @@ config HUGETLB_PAGE_FREE_VMEMMAP > > depends on X86_64 > > depends on SPARSEMEM_VMEMMAP > > > Now that you have no longer have the directmap in basepages limitation, I suppose you no > longer need explicit arch support for HUGETLB_PAGE_FREE_VMEMMAP right? > > If so, I suppose you might be able to remove the 'depends on X86_64' part and "gain" > ARM64, PPC, etc support. You are right. This is the next step I want to do. Also, include IA64 and RISCV. > > Joao