Re: [PATCH v9 3/4] kselftest: mm: integrate huge page checks

From: Zi Yan

Date: Fri Oct 02 2026 - 13:22:28 EST


On 1 Oct 2026, at 17:17, Yeoreum Yun wrote:

> check_large_folios() only checks for large folios without distinguishing
> between anonymous and file-backed huge pages.
>
> To add huge page type checking, integrate the huge page checks into
> __check_huge() and __check_type():
>
> 1. If hpage_size == pmd_pagesize, check PAGE_IS_HUGE instead of using
> check_large_folios(), since only the mapping type matters. This
> identifies PMD-mapped huge pages.
>
> 2. Otherwise, use check_large_folios() to detect large folios. This
> covers mTHP cases.
>
> 3. Check the folio flags according to the huge page type via
> __check_type()
>
> Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Suggested-by: Zi Yan <ziy@xxxxxxxxxx>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
> ---
> tools/testing/selftests/mm/vm_util.c | 90 ++++++++++++++++++++++--------------
> 1 file changed, 56 insertions(+), 34 deletions(-)
>
LGTM.

Acked-by: Zi Yan <ziy@xxxxxxxxxx>

Best Regards,
Yan, Zi