Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

From: Mike Kravetz
Date: Mon Apr 27 2020 - 15:11:53 EST


On 4/27/20 10:25 AM, Mike Kravetz wrote:
> On 4/26/20 10:04 PM, Sandipan Das wrote:
>> On 18/04/20 12:20 am, Mike Kravetz wrote:
>>> Now that architectures provide arch_hugetlb_valid_size(), parsing
>>> of "hugepagesz=" can be done in architecture independent code.
>>
>> This isn't working as expected on powerpc64.
>>
>> [ 0.000000] Kernel command line: root=UUID=dc7b49cf-95a2-4996-8e7d-7c64ddc7a6ff hugepagesz=16G hugepages=2
>> [ 0.000000] HugeTLB: huge pages not supported, ignoring hugepagesz = 16G
>> [ 0.000000] HugeTLB: huge pages not supported, ignoring hugepages = 2
>> [ 0.284177] HugeTLB registered 16.0 MiB page size, pre-allocated 0 pages
>> [ 0.284182] HugeTLB registered 16.0 GiB page size, pre-allocated 0 pages
>> [ 2.585062] hugepagesz=16G
>> [ 2.585063] hugepages=2
>>
>
> In the new arch independent version of hugepages_setup, I added the following
> code in patch 4 off this series:
>
>> + if (!hugepages_supported()) {
>> + pr_warn("HugeTLB: huge pages not supported, ignoring hugepages = %s\n", s);
>> + return 0;
>> + }
>> +
>
> The easy solution is to remove all the hugepages_supported() checks from
> command line parsing routines and rely on the later check in hugetlb_init().

Here is a patch to address the issue. Sorry, as my series breaks all hugetlb
command line processing on powerpc.

Sandipan, can you test the following patch?