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=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 04007C4727C for ; Wed, 30 Sep 2020 02:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B165C20773 for ; Wed, 30 Sep 2020 02:57:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="st7S9SNA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729862AbgI3C5X (ORCPT ); Tue, 29 Sep 2020 22:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729446AbgI3C5V (ORCPT ); Tue, 29 Sep 2020 22:57:21 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59707C0613D1 for ; Tue, 29 Sep 2020 19:57:19 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id s19so129721plp.3 for ; Tue, 29 Sep 2020 19:57:19 -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=CdiVN4MoIYXNti+D+K08kG5fvyK/5dVLiPfaQfAKwuc=; b=st7S9SNAhg2fIivqpQzhvrmcfW5mzGTGWG1LtzKvUjHGTdp9KEpCjllhjbUkwx8WMn p+cm1bIZEbYMfWgnoa4eAa+w8rrpDyy6EioF5U9eOyqidEfxrmln7sdWs2yOwSMV3nO/ Pay10GF4e4N7hV0bKa6EAtxlwraP7NZsceZJljRUjsjHPwwAe2sMnECuiu4rO9lbmXQ7 /w5bVInm5XamYfffGzqU1JfC/KFvZBOXUYsy+0bmp1AGwShCNSodR80vnTfEYSwkh8VB j07h44UWD3b/JibpXDuqHYCJgEh7xtwuiZfR5xl7OPdxhe5PT9k493K2YrBfb/zTdEi3 IhSg== 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=CdiVN4MoIYXNti+D+K08kG5fvyK/5dVLiPfaQfAKwuc=; b=ZYp4FN1S92dxk1a+WE/zsvu7NsmZf2/dZt5lhUlPe8W18K3RZei6x2w+2FiEYJR6LL /yzlt36E0MNlhAILwFKe5z5Jb70vw5B5vi0Mm3MJ/xVc6RXatOkHycvBL//mftym8vx/ xVauzorTn+Iy8Zpu6E0oBLW50EZfCyWa2nwJtjPZWfSP9Ardi4fTvHr3lPi1HyEiN8zr aFtVLPmW8UbRHNT3387pTpR73DaX5tlzXRrgc1cyhTv/uXdW8gIazlQsr2UNwiqxaVaI gKiJkbx4+ANtYfw/D9jibJrt/XD9V6ZeeIYw53/jW1u2l3V13f4KDaBMcVAGnVHweTHm 2VBg== X-Gm-Message-State: AOAM530oJgEjjndVAUb0HgJN2V7mNJyWgrMVOAGeVPYz3vnAw5SvmQOB yRQdEfgpcGRmkanOLOOWtMvo3aeTRh+iKjWV9O6dgw== X-Google-Smtp-Source: ABdhPJzX8idHqOKVy8umpqeXFwxgXNk3IKXSzqUAsXAqoXS95sel9yV5OAk2sSs+jMNGas6VmwSpjHHlG7L1C4y7lw4= X-Received: by 2002:a17:90a:bc8d:: with SMTP id x13mr550726pjr.229.1601434638340; Tue, 29 Sep 2020 19:57:18 -0700 (PDT) MIME-Version: 1.0 References: <20200915125947.26204-1-songmuchun@bytedance.com> <20200915125947.26204-4-songmuchun@bytedance.com> <07e7d497-e800-be28-dfea-047579c3b27d@oracle.com> In-Reply-To: <07e7d497-e800-be28-dfea-047579c3b27d@oracle.com> From: Muchun Song Date: Wed, 30 Sep 2020 10:56:42 +0800 Message-ID: Subject: Re: [External] Re: [RFC PATCH 03/24] mm/hugetlb: Introduce a new config HUGETLB_PAGE_FREE_VMEMMAP To: Mike Kravetz Cc: Jonathan Corbet , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 7:41 AM Mike Kravetz wrote: > > On 9/15/20 5:59 AM, Muchun Song wrote: > > The purpose of introducing HUGETLB_PAGE_FREE_VMEMMAP is to configure > > whether to enable the feature of freeing unused vmemmap associated > > with HugeTLB pages. > > > > Signed-off-by: Muchun Song > > --- > > fs/Kconfig | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/fs/Kconfig b/fs/Kconfig > > index 976e8b9033c4..61e9c08096ca 100644 > > --- a/fs/Kconfig > > +++ b/fs/Kconfig > > @@ -245,6 +245,21 @@ config HUGETLBFS > > config HUGETLB_PAGE > > def_bool HUGETLBFS > > > > +config HUGETLB_PAGE_FREE_VMEMMAP > > + bool "Free unused vmemmap associated with HugeTLB pages" > > + default n > > + depends on HUGETLB_PAGE > > + depends on SPARSEMEM_VMEMMAP > > + depends on HAVE_BOOTMEM_INFO_NODE > > + help > > + There are many struct page structure associated with each HugeTLB > > + page. But we only use a few struct page structure. In this case, > > + it waste some memory. It is better to free the unused struct page > > + structures to buddy system which can save some memory. For > > + architectures that support it, say Y here. > > + > > + If unsure, say N. > > + > > I could be wrong, but I believe the convention is introduce the config > option at the same time code which depends on the option is introduced. > Therefore, it might be better to combine with the next patch. Yeah, great. Will do that. Thanks. > > Also, it looks like most of your development was done on x86. Should > this option be limited to x86 only for now? Now only the x86 has the HAVE_BOOTMEM_INFO_NODE option. So maybe this is enough :) > -- > Mike Kravetz -- Yours, Muchun