Re: [PATCH] mm/debug_vm_pgtable: Ensure THP availability via has_transparent_hugepage()

From: Anshuman Khandual
Date: Tue May 18 2021 - 06:06:51 EST




On 5/18/21 2:20 PM, Christophe Leroy wrote:
>
>
> Le 18/05/2021 à 10:13, Anshuman Khandual a écrit :
>> On certain platforms, THP support could not just be validated via the build
>> option CONFIG_TRANSPARENT_HUGEPAGE. Instead has_transparent_hugepage() also
>> needs to be called upon to verify THP runtime support. Otherwise the debug
>> test might just run into unusable THP helpers like in the case of a 4K hash
>
> s/might/will/

Sure, will replace.

>
>> config on powerpc platform [1]. This just moves all pfn_pmd() and pfn_pud()
>> after THP runtime validation with has_transparent_hugepage() which prevents
>> the mentioned problem.
>>
>> [1] https://bugzilla.kernel.org/show_bug.cgi?id=213069
>>
>> Cc: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx>
>> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
>> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>> Cc: linux-mm@xxxxxxxxx
>> Cc: linux-kernel@xxxxxxxxxxxxxxx
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
>
> There should be a Fixes:  tag

Considering pmd_basic_tests() as the earliest test which is being
impacted here, this actually fixes an earlier fix which tried the
very same thing but was probably not complete. But it also applies
to portions of advanced tests which came later on as well, which
should have taken this problem into account.

Fixes: 787d563b8642 ("mm/debug_vm_pgtable: fix kernel crash by checking for THP support")

>
>> ---
>> This applies on v5.13-rc2 after the following patches.
>>
>> [1] https://lore.kernel.org/linux-mm/20210419071820.750217-1-liushixin2@xxxxxxxxxx/
>> [2] https://lore.kernel.org/linux-mm/20210419071820.750217-2-liushixin2@xxxxxxxxxx/
>
> I can't see any fixes: tag in those patches, and their subject line even targets them to -next. Are they meant to go to 5.13 and stable ?
>
> If not, how do you coordinate between your patch that must go in 5.13 and in stable, and those two patches ? Shouldn't your patch go first and those other patches be rebased on top ?

Right, will rebase this patch on v5.13-rc2 directly without those two
patches. Hence this can be merged in v5.13 and backported to stable
if required.