On 12 Mar 2026, at 7:40, Chunyu Hu wrote:

> The test requires thp, skip the test when thp is not available to avoid
> false positive.
>
> Tested with thp disabled kernel.
> Before the fix:
>   # --------------------------------
>   # running ./transhuge-stress -d 20
>   # --------------------------------
>   # TAP version 13
>   # 1..1
>   # transhuge-stress: allocate 1453 transhuge pages, using 2907 MiB virtual 
> memory and 11 MiB of ram
>   # Bail out! MADV_HUGEPAGE# Planned tests != run tests (1 != 0)
>   # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0
>   # [FAIL]
>   not ok 60 transhuge-stress -d 20 # exit=1
>
> After the fix:
>   # --------------------------------
>   # running ./transhuge-stress -d 20
>   # --------------------------------
>   # 1..0 # SKIP Transparent Hugepages not available
>   # [SKIP]
>   ok 5 transhuge-stress -d 20 # SKIP
>
> CC: Li Wang <[email protected]>
> Signed-off-by: Chunyu Hu <[email protected]>
> ---
>  tools/testing/selftests/mm/transhuge-stress.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
LGTM.

Reviewed-by: Zi Yan <[email protected]>

Best Regards,
Yan, Zi

Reply via email to