# Re: powerpc/e500: WARNING: at mm/hugetlb.c:4755 hugetlb\_add\_hstate

- From: David Hildenbrand (Red Hat) \<david@kernel.org\>
- Date: 2025-11-07 14:18:26 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2025/11/9536344
- Thread: https://ratatoskr.run/linuxppc-dev/2025/10/9536279/t.md

```text
On 07.11.25 13:35, Sourabh Jain wrote:
>
> On 07/11/25 14:32, David Hildenbrand (Red Hat) wrote:
>> On 07.11.25 09:00, Sourabh Jain wrote:
>>>
>>>
>>> On 06/11/25 20:32, David Hildenbrand (Red Hat) wrote:
>>>>>> Yes, we discussed that in [1].
>>>>>>
>>>>>> We'll have to set ARCH_HAS_GIGANTIC_PAGE on ppc and increase
>>>>>> MAX_FOLIO_ORDER, because apparently, there might be ppc configs that
>>>>>> have even larger hugetlb sizes than PUDs.
>>>>>>
>>>>>> @Cristophe, I was under the impression that you would send a fix. Do
>>>>>> you
>>>>>> want me to prepare something and send it out?
>>>>>
>>>>> Indeed I would have liked to better understand the implications of all
>>>>> this, but I didn't have the time.
>>>>
>>>> Indeed, too me longer than it should to understand and make up my mind
>>>> as well.
>>>>
>>>>>
>>>>> By the way, you would describe the fix better than me so yes if you
>>>>> can
>>>>> prepare and send a fix please do.
>>>>
>>>> I just crafted the following. I yet have to test it more, some early
>>>> feedback+testing would be appreciated!
>>>>
>>>>   From 274928854644c49c92515f8675c090dba15a0db6 Mon Sep 17 00:00:00 2001
>>>> From: "David Hildenbrand (Red Hat)" <david@kernel.org>
>>>> Date: Thu, 6 Nov 2025 11:31:45 +0100
>>>> Subject: [PATCH] mm: fix MAX_FOLIO_ORDER on some ppc64 configs with
>>>> hugetlb
>>>
>>> b4 did not detect this patch, and manually copying the patch text
>>> from this
>>> reply also did not apply cleanly on upstream master and linuxppc
>>> master/next.
>>
>> I have it on a branch here:
>>
>> https://github.com/davidhildenbrand/linux/commit/274928854644c49c92515f8675c090dba15a0db6
>>
>>
>> https://github.com/davidhildenbrand/linux.git max_folio_order
>>
>
> The above patch resolves the issue reported in this thread.
>
> Thanks for the fix David.

Okay, I'll have to do some more testing (and I've been failing for days to get a ppc64 machine internally provisioned automatically). Will send it out early next week, thanks!

-- 
Cheers

David

```
