> Refactor split_huge_page_test with kselftest_harness, since there is a
> magic counting about valid tests.

> The idea is simple:

> For standalone test, put it into TEST().

> For tests iterating order/offset, define fixture and variant with
> order and offset. And skip it if order/offset is not valid.

> No functional change is expected.

Sounds good.

> -static void split_pmd_zero_pages(void)
> +TEST(split_pmd_zero_pages)
> {
>       char *one_page;
>       int nr_hpages = 4;
>       size_t len = nr_hpages * pmd_pagesize;

nr_hpages and len appeared many times and 
david use nr_thps and thp_area_size rename it.
and maybe we can unify it and make it into FIXTURE and init.
 
> +     prepare_proc_fd();
> +
>       one_page = allocate_zero_filled_hugepage(len);
>       verify_rss_anon_split_huge_page_all_zeroes(one_page, nr_hpages, len);
> -     ksft_test_result_pass("Split zero filled huge pages successful\n");
>       free(one_page);
> +
> +     cleanup_proc_fd();
>  }
 


Best regards,
wang lian

Reply via email to