Re: [PATCH v2 2/5] selftests/mm: soft-dirty: skip two tests when thp is not available

From: Mike Rapoport

Date: Mon Mar 16 2026 - 02:26:00 EST


On Mon, Mar 16, 2026 at 12:43:32PM +0800, Chunyu Hu wrote:
> The test_hugepage test contain two sub tests. If just reporting one skip
> when thp not available, there will be error in the log because the test
> count don't match the test plan. Change to skip two tests by running the
> ksft_test_result_skip twice in this case.

...

> Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@xxxxxxxxxx>
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> CC: Li Wang <liwang@xxxxxxxxxx>
> Signed-off-by: Chunyu Hu <chuhu@xxxxxxxxxx>
> ---
> Changes in v2:
> - add reviewed by from Lorenzo and Zi
> - add acked-by from David
> ---
> tools/testing/selftests/mm/soft-dirty.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c
> index 59c0dbe99a9b..bcfcac99b436 100644
> --- a/tools/testing/selftests/mm/soft-dirty.c
> +++ b/tools/testing/selftests/mm/soft-dirty.c
> @@ -82,7 +82,9 @@ static void test_hugepage(int pagemap_fd, int pagesize)
> int i, ret;
>
> if (!thp_is_enabled()) {
> - ksft_test_result_skip("Transparent Hugepages not available\n");
> + ksft_print_msg("Transparent Hugepages not available\n");
> + ksft_test_result_skip("Test %s huge page allocation\n", __func__);
> + ksft_test_result_skip("Test %s huge page dirty bit\n", __func__);

There's already similar block when the page is not collapsed, but reworking
the test flow can be done on top as a separate commit.

Feel free to add

Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

--
Sincerely yours,
Mike.