[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <533f85f9-82e2-bfa7-3788-4b2a668daedf@redhat.com>
Date: Fri, 1 Apr 2022 12:46:00 +0200
From: David Hildenbrand <david@...hat.com>
To: Peng Liu <liupeng256@...wei.com>, mike.kravetz@...cle.com,
akpm@...ux-foundation.org, yaozhenguo1@...il.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v2 2/2] hugetlb: Fix return value of __setup handlers
On 01.04.22 12:12, Peng Liu wrote:
> When __setup() return '0', using invalid option values causes the
> entire kernel boot option string to be reported as Unknown. Hugetlb
> calls __setup() and will return '0' when set invalid parameter
> string.
>
> The following phenomenon is observed:
> 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"
>
> Since hugetlb will print warn or error information before return for
> invalid parameter string, just use return '1' to avoid print again.
>
> Signed-off-by: Peng Liu <liupeng256@...wei.com>
> ---
> mm/hugetlb.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 9cd746432ca9..6dde34c115c9 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -4131,12 +4131,11 @@ static int __init hugepages_setup(char *s)
> int count;
> unsigned long tmp;
> char *p = s;
> - int ret = 1;
Adding this in #1 to remove it in #2 is a bit sub-optimal IMHO.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists