From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36152 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731500AbgDVKoF (ORCPT ); Wed, 22 Apr 2020 06:44:05 -0400 From: "Aneesh Kumar K.V" Subject: Re: [PATCH v3 3/4] hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate In-Reply-To: <20200417185049.275845-4-mike.kravetz@oracle.com> References: <20200417185049.275845-1-mike.kravetz@oracle.com> <20200417185049.275845-4-mike.kravetz@oracle.com> Date: Wed, 22 Apr 2020 16:12:26 +0530 Message-ID: <87blnj4x9p.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-s390-owner@vger.kernel.org List-ID: To: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-doc@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Dave Hansen , Jonathan Corbet , Longpeng , Christophe Leroy , Randy Dunlap , Mina Almasry , Peter Xu , Nitesh Narayan Lal , Andrew Morton Mike Kravetz writes: > The routine hugetlb_add_hstate prints a warning if the hstate already > exists. This was originally done as part of kernel command line > parsing. If 'hugepagesz=' was specified more than once, the warning > pr_warn("hugepagesz= specified twice, ignoring\n"); > would be printed. > > Some architectures want to enable all huge page sizes. They would > call hugetlb_add_hstate for all supported sizes. However, this was > done after command line processing and as a result hstates could have > already been created for some sizes. To make sure no warning were > printed, there would often be code like: > if (!size_to_hstate(size) > hugetlb_add_hstate(ilog2(size) - PAGE_SHIFT) > > The only time we want to print the warning is as the result of command > line processing. Does this patch break hugepages=x command line? I haven't tested this yet. But one of the details w.r.t. skipping that hugetlb_add_hstate is to make sure we can configure the max_huge_pages. >So, remove the warning from hugetlb_add_hstate and > add it to the single arch independent routine processing "hugepagesz=". > After this, calls to size_to_hstate() in arch specific code can be > removed and hugetlb_add_hstate can be called without worrying about > warning messages. > -aneesh