powerpc/e500: WARNING: at mm/hugetlb.c:4755 hugetlb_add_hstate
Ritesh Harjani (IBM)
ritesh.list at gmail.com
Wed Nov 12 21:41:57 AEDT 2025
Christophe Leroy <christophe.leroy at csgroup.eu> writes:
> Le 10/11/2025 à 12:27, David Hildenbrand (Red Hat) a écrit :
>> Thanks for the review!
>>
>>>
>>> So I think what you want instead is:
>>>
>>> diff --git a/arch/powerpc/platforms/Kconfig.cputype
>>> b/arch/powerpc/platforms/Kconfig.cputype
>>> index 7b527d18aa5ee..1f5a1e587740c 100644
>>> --- a/arch/powerpc/platforms/Kconfig.cputype
>>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>>> @@ -276,6 +276,7 @@ config PPC_E500
>>> select FSL_EMB_PERFMON
>>> bool
>>> select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
>>> + select ARCH_HAS_GIGANTIC_PAGE if ARCH_SUPPORTS_HUGETLBFS
>>> select PPC_SMP_MUXED_IPI
>>> select PPC_DOORBELL
>>> select PPC_KUEP
>>>
>>>
>>>
>>>> select ARCH_HAS_KCOV
>>>> select ARCH_HAS_KERNEL_FPU_SUPPORT if PPC64 && PPC_FPU
>>>> select ARCH_HAS_MEMBARRIER_CALLBACKS
>>>> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/
>>>> platforms/Kconfig.cputype
>>>> index 7b527d18aa5ee..4c321a8ea8965 100644
>>>> --- a/arch/powerpc/platforms/Kconfig.cputype
>>>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>>>> @@ -423,7 +423,6 @@ config PPC_64S_HASH_MMU
>>>> config PPC_RADIX_MMU
>>>> bool "Radix MMU Support"
>>>> depends on PPC_BOOK3S_64
>>>> - select ARCH_HAS_GIGANTIC_PAGE
>>>
>>> Should remain I think.
>>>
>>>> default y
>>>> help
>>>> Enable support for the Power ISA 3.0 Radix style MMU. Currently
>>
>>
>> We also have PPC_8xx do a
>>
>> select ARCH_SUPPORTS_HUGETLBFS
>>
>> And of course !PPC_RADIX_MMU (e.g., PPC_64S_HASH_MMU) through
>> PPC_BOOK3S_64.
>>
>> Are we sure they cannot end up with gigantic folios through hugetlb?
>>
>
> Yes indeed. My PPC_8xx is OK because I set CONFIG_ARCH_FORCE_MAX_ORDER=9
> (largest hugepage is 8M) but I do get the warning with the default value
> which is 8 (with 16k pages).
>
> For PPC_64S_HASH_MMU, max page size is 16M, we get no warning with
> CONFIG_ARCH_FORCE_MAX_ORDER=8 which is the default value but get the
> warning with CONFIG_ARCH_FORCE_MAX_ORDER=7
>
This made me thinking.. Currently we can also get warning even on
book3s64 when CONFIG_PPC_RADIX_MMU=n is selected because max page size
in case of HASH can be 16G. I guess this was not getting tested in
regular CI because it requires us to disable RADIX config during build.
We will end up in this path on Hash where MAX_PAGE_ORDER is
CONFIG_ARCH_FORCE_MAX_ORDER which is 8, this is because we HAVE
ARCH_HAS_GIGANTIC_PAGE=n in case of only HASH.
More information about the Linuxppc-dev
mailing list