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 AA1A7C433EF for ; Tue, 29 Mar 2022 03:59:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4FF68D0002; Mon, 28 Mar 2022 23:59:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD6BA8D0001; Mon, 28 Mar 2022 23:59:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A77CD8D0002; Mon, 28 Mar 2022 23:59:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 910CA8D0001 for ; Mon, 28 Mar 2022 23:59:45 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 60D931204FB for ; Tue, 29 Mar 2022 03:59:45 +0000 (UTC) X-FDA: 79296069930.08.F2623AB Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf05.hostedemail.com (Postfix) with ESMTP id 3DDDD100002 for ; Tue, 29 Mar 2022 03:59:43 +0000 (UTC) Received: from kwepemi100018.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KSG4T2dCFzgY7b; Tue, 29 Mar 2022 11:58:01 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi100018.china.huawei.com (7.221.188.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 11:59:39 +0800 Received: from [10.174.179.19] (10.174.179.19) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 11:59:38 +0800 Message-ID: Date: Tue, 29 Mar 2022 11:59:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] hugetlb: Fix hugepages_setup when deal with pernode Content-Language: en-US To: Mike Kravetz , , , , , References: <20220324074037.2024608-1-liupeng256@huawei.com> <361111c6-921b-e129-edf3-367748f6497e@oracle.com> From: "liupeng (DM)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.19] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of liupeng256@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liupeng256@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3DDDD100002 X-Stat-Signature: 31pm8qjyqn4i9kzw5xca4hmekz1pewmz X-HE-Tag: 1648526383-592165 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 2022/3/29 10:46, Mike Kravetz wrote: > Yes, I agree that the change is needed and the current behavior is > unacceptable. > > One remaining question is the change from returning '0' to '1' in the case > of error. I do understand this is to prevent the invalid parameter string > from being passed to init. It may not be correct/right, but in every other > case where an invalid parameter in encountered in hugetlb command line > processing we return "0". Should we perhaps change all these other places > to be consistent? I honestly do not know what is the appropriate behavior > in these situations. Thank you for your carefulness and question. I have checked default_hugepagesz_setup and hugepages_setup will both print some information before return '0', so there is no need to print again in "Unknown kernel command line parameters". Should I send another patch to repair the rest "return 0" in hugetlb? Some other tests for current linux-master: cmdline: hugepagesz=1G hugepages=1 hugepagesz=1G hugepages=2 dmesg: HugeTLB: hugepagesz=1G specified twice, ignoring Unknown kernel command line parameters " hugepagesz=1G hugepages=2" cmdline: hugepagesz=1Y hugepages=1 dmesg: HugeTLB: unsupported hugepagesz=1Y HugeTLB: hugepages=1 does not follow a valid hugepagesz, ignoring Unknown kernel command line parameters "hugepagesz=1Y hugepages=1" -- Peng Liu .