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) <[email protected]>
Suggested-by: Zi Yan <[email protected]>
Signed-off-by: Yeoreum Yun <[email protected]>
---

LGTM, with nits from Sarthak addressed,
Reviewed-by: Baolin Wang <[email protected]>
Tested-by: Baolin Wang <[email protected]>

Reply via email to