[RESEND PATCH v7 09/10] selftests/mm/cow: Generalize do_run_with_thp() helper

David Hildenbrand david at redhat.com
Mon Nov 27 06:17:09 PST 2023


On 27.11.23 15:11, Ryan Roberts wrote:
> On 27/11/2023 13:59, David Hildenbrand wrote:
>>>>
>>>>> +    pmdsize = read_pmd_pagesize();
>>>>> +    if (pmdsize)
>>>>> +        ksft_print_msg("[INFO] detected PMD-mapped THP size: %zu KiB\n",
>>>>
>>>> Maybe simply: "detected PMD size". Zes, we read it via the THP interface, but
>>>> that shouldn't matter much.
>>>
>>> Err, just want to clarify what you are suggesting. With the current patch you
>>> will see something like:
>>
>> Not with this patch, but with the other ones, yes :)
> 
> Yep, we are on the same page (folio)...
> 
>>
>>>
>>> [INFO] detected PMD-mapped THP size: 2048 KiB
>>> [INFO] detected small-sized THP size: 64 KiB
>>> [INFO] detected small-sized THP size: 128 KiB
>>> ...
>>> [INFO] detected small-sized THP size: 1024 KiB
>>>
>>>
>>> Are you suggesting something like this:
>>>
>>> [INFO] detected PMD size: 2048 KiB
>>> [INFO] detected THP size: 64 KiB
>>> [INFO] detected THP size: 128 KiB
>>> ...
>>> [INFO] detected THP size: 2048 KiB
>>>
>>
>> Yes. If you'd detect that 2M is actually disabled, you could still log the PMD
>> size only.
> 
> Note that in the final patch, where I test the other THP sizes, I'm not
> detecting which sizes the sysadmin has enabled, I'm detecting the set of sizes
> that can be enabled, then explicitly enabling the size (exclusively) when I test
> it. So there is no chance of reading PMD size but not having 2M THP. Minor point
> though.

Ah, makes sense, I missed that and thought we'd check if that size is 
actually possible.

-- 
Cheers,

David / dhildenb




More information about the linux-arm-kernel mailing list