On 9/24/26 21:11, 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]>
> ---

Instead of merging both things (detecting mapping vs. detecting anon vs. file),
could we simply perform the anon vs. file change separately?

Doing another pagemap walk that focuses on that should end up with something
that is easier to read.

-- 
Cheers,

David

Reply via email to