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

Mike Rapoport
2026-03-16T06:25:56Z

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@kernel.org>
> Acked-by: David Hildenbrand (Arm) <david@kernel.org>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> CC: Li Wang <liwang@redhat.com>
> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
> ---
> 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@kernel.org>

--
Sincerely yours,
Mike.