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

From: Baolin Wang

Date: Tue Sep 29 2026 - 02:53:49 EST




On 9/25/26 3:11 AM, 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():

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.

Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Suggested-by: Zi Yan <ziy@xxxxxxxxxx>
Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
---

LGTM, with nits from Sarthak addressed,
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
Tested-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>