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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 BF9BCC4727C for ; Tue, 29 Sep 2020 23:42:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE7A820897 for ; Tue, 29 Sep 2020 23:42:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ii3wW6QN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE7A820897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 12EDF8E0001; Tue, 29 Sep 2020 19:42:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DFE96B0062; Tue, 29 Sep 2020 19:42:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11628E0001; Tue, 29 Sep 2020 19:42:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id D96226B005D for ; Tue, 29 Sep 2020 19:42:02 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 97447181AC9CB for ; Tue, 29 Sep 2020 23:42:02 +0000 (UTC) X-FDA: 77317724484.24.limit75_0c0426a2718e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 7A2371A4A0 for ; Tue, 29 Sep 2020 23:42:02 +0000 (UTC) X-HE-Tag: limit75_0c0426a2718e X-Filterd-Recvd-Size: 5562 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Sep 2020 23:42:01 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TNdgYP037001; Tue, 29 Sep 2020 23:41:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=t2UV57EDD+VEpRQhOAwWhXts6sZaD3sFlbnYQVKwXYQ=; b=ii3wW6QNYTCIFJzCr7KGtOeDgvrxFxe00GK1/YWKud/UU6aeQmT3LtSooSZvfU+7eiTr Mv8PsVhzR+VDK3LfCpG+XPeXBLTzhd6PFzqxOC0rYaDKTrh3c2cHOX0OsZLZ0IzFySDf CNZ0k3WJpiepmvPVmvtP4AfgEOcQGxEEmWOpdajU8Qv1RKAHlIX6qP59FvUq3fn8vbpB +5EAf8d+qa3nPLOsdOPI9ebbPZin6yhCcYQ4eG1jnNbBABVVDxJUf96OMaQXRB5Sh7vl 8D93qbMCpiXs1MyvJpNgzN0TvnaupfPUY3+WT4LHzbNXuedjPPwRFXL3nq0dBUub3QgR Ig== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 33swkkwpx8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 29 Sep 2020 23:41:47 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TNekA6018937; Tue, 29 Sep 2020 23:41:47 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 33tfdsvyd6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Sep 2020 23:41:47 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08TNfi1A028239; Tue, 29 Sep 2020 23:41:44 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Sep 2020 16:41:44 -0700 Subject: Re: [RFC PATCH 03/24] mm/hugetlb: Introduce a new config HUGETLB_PAGE_FREE_VMEMMAP To: Muchun Song , corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <20200915125947.26204-1-songmuchun@bytedance.com> <20200915125947.26204-4-songmuchun@bytedance.com> From: Mike Kravetz Message-ID: <07e7d497-e800-be28-dfea-047579c3b27d@oracle.com> Date: Tue, 29 Sep 2020 16:41:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200915125947.26204-4-songmuchun@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=2 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290200 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=2 mlxlogscore=999 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290200 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 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. Also, it looks like most of your development was done on x86. Should this option be limited to x86 only for now? -- Mike Kravetz