2020-04-09 22:10:21

by Mike Kravetz

[permalink] [raw]
Subject: Re: [PATCH] Documentation: hugetlb: Update hugetlb options

On 4/9/20 2:58 PM, Peter Xu wrote:
> The hugepage options are not documented clearly.
>
> Firstly, default_hugepagesz= should always be specified after the
> declaration of the same type of huge page using hugepagesz=. For
> example, if we boot a x86_64 system with kernel cmdline
> "default_hugepagesz=2M", we'll get a very funny error message:
>
> "HugeTLB: unsupported default_hugepagesz 2097152. Reverting to 2097152"
>
> It's understandable from code-wise because when hugetlb_init() we
> didn't have the 2M page hstate registered, so it's unsupported.
> However 2M is actually the default huge page size on x86_64, so we'll
> register it right after the error message. However it's very
> confusing if without these knowledges.
>
> Secondly, hugepages= option must be used _after_ another hugepagesz=.
> The word "interleave" is fine but it didn't declare the fact that
> each of the hugepages= option will be applied to the previous parsed
> hugepagesz= option.
>
> State all these clear.
>
> Signed-off-by: Peter Xu <[email protected]>

Hi Peter,

Did you happen to see this patch series?

https://lore.kernel.org/linux-mm/[email protected]/

That should address the documentation issue and more.
--
Mike Kravetz


2020-04-09 22:22:35

by Peter Xu

[permalink] [raw]
Subject: Re: [PATCH] Documentation: hugetlb: Update hugetlb options

On Thu, Apr 09, 2020 at 03:08:07PM -0700, Mike Kravetz wrote:
> On 4/9/20 2:58 PM, Peter Xu wrote:
> > The hugepage options are not documented clearly.
> >
> > Firstly, default_hugepagesz= should always be specified after the
> > declaration of the same type of huge page using hugepagesz=. For
> > example, if we boot a x86_64 system with kernel cmdline
> > "default_hugepagesz=2M", we'll get a very funny error message:
> >
> > "HugeTLB: unsupported default_hugepagesz 2097152. Reverting to 2097152"
> >
> > It's understandable from code-wise because when hugetlb_init() we
> > didn't have the 2M page hstate registered, so it's unsupported.
> > However 2M is actually the default huge page size on x86_64, so we'll
> > register it right after the error message. However it's very
> > confusing if without these knowledges.
> >
> > Secondly, hugepages= option must be used _after_ another hugepagesz=.
> > The word "interleave" is fine but it didn't declare the fact that
> > each of the hugepages= option will be applied to the previous parsed
> > hugepagesz= option.
> >
> > State all these clear.
> >
> > Signed-off-by: Peter Xu <[email protected]>
>
> Hi Peter,
>
> Did you happen to see this patch series?
>
> https://lore.kernel.org/linux-mm/[email protected]/
>
> That should address the documentation issue and more.

Great!

I missed that, but I'll definitely read it (probably tomorrow). Let's
ignore this patch then.

Thanks,

--
Peter Xu

2020-04-10 12:04:46

by Nitesh Narayan Lal

[permalink] [raw]
Subject: Re: [PATCH] Documentation: hugetlb: Update hugetlb options


On 4/9/20 6:18 PM, Peter Xu wrote:
> On Thu, Apr 09, 2020 at 03:08:07PM -0700, Mike Kravetz wrote:
>> On 4/9/20 2:58 PM, Peter Xu wrote:
>>> The hugepage options are not documented clearly.
>>>
>>> Firstly, default_hugepagesz= should always be specified after the
>>> declaration of the same type of huge page using hugepagesz=. For
>>> example, if we boot a x86_64 system with kernel cmdline
>>> "default_hugepagesz=2M", we'll get a very funny error message:
>>>
>>> "HugeTLB: unsupported default_hugepagesz 2097152. Reverting to 2097152"
>>>
>>> It's understandable from code-wise because when hugetlb_init() we
>>> didn't have the 2M page hstate registered, so it's unsupported.
>>> However 2M is actually the default huge page size on x86_64, so we'll
>>> register it right after the error message. However it's very
>>> confusing if without these knowledges.
>>>
>>> Secondly, hugepages= option must be used _after_ another hugepagesz=.
>>> The word "interleave" is fine but it didn't declare the fact that
>>> each of the hugepages= option will be applied to the previous parsed
>>> hugepagesz= option.
>>>
>>> State all these clear.
>>>
>>> Signed-off-by: Peter Xu <[email protected]>
>> Hi Peter,
>>
>> Did you happen to see this patch series?
>>
>> https://lore.kernel.org/linux-mm/[email protected]/
>>
>> That should address the documentation issue and more.
> Great!
>
> I missed that, but I'll definitely read it (probably tomorrow). Let's
> ignore this patch then.

My bad, I didn't realize that Mike has already  pointed you in the right direction.
Please ignore my earlier email. :)

>
> Thanks,
>
--
Nitesh


Attachments:
signature.asc (849.00 B)
OpenPGP digital signature