Re: [PATCH v4 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

From: Wei Yang
Date: Thu Aug 14 2025 - 23:15:19 EST


On Thu, Aug 14, 2025 at 10:39:12PM -0400, Zi Yan wrote:
>and rename it to is_backed_by_folio().
>
>is_backed_by_folio() checks if the given vaddr is backed a folio with
>a given order. It does so by:
>1. getting the pfn of the vaddr;
>2. checking kpageflags of the pfn;
>
>if order is greater than 0:
>3. checking kpageflags of the head pfn;
>4. checking kpageflags of all tail pfns.
>
>pmd_order is added to split_huge_page_test.c and replaces max_order.
>
>Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>

Reviewed-by: Wei Yang <richard.weiyang@xxxxxxxxx>

--
Wei Yang
Help you, Help me