Re: [PATCH] ksm_tests: Skip hugepage test when Transparent Hugepages are disabled
From: Lorenzo Stoakes
Date: Mon Jun 23 2025 - 05:03:01 EST
Hi Li,
This is breaking the mm-new mm selftest test build, did you have some local
changes you didn't submit by mistake?
You seem to be returning KSFT_SKIP from a void function.
I enclose a simple fix-patch that fixes the issue, but obviously you should
check to see if this is still doing what you want :)
Cheers, Lorenzo
On Sat, Jun 21, 2025 at 08:48:08AM +0800, Li Wang wrote:
[snip]
> diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c
> index 8e1462ce0532..72d8ded87756 100644
> --- a/tools/testing/selftests/mm/soft-dirty.c
> +++ b/tools/testing/selftests/mm/soft-dirty.c
> @@ -6,8 +6,10 @@
> #include <stdint.h>
> #include <malloc.h>
> #include <sys/mman.h>
> +
> #include "../kselftest.h"
> #include "vm_util.h"
> +#include "thp_settings.h"
>
> #define PAGEMAP_FILE_PATH "/proc/self/pagemap"
> #define TEST_ITERATIONS 10000
> @@ -78,8 +80,13 @@ static void test_hugepage(int pagemap_fd, int pagesize)
> {
> char *map;
> int i, ret;
> - size_t hpage_len = read_pmd_pagesize();
>
> + if (!thp_is_enabled()) {
> + printf("Skipping test: Transparent Hugepages not available\n");
> + return KSFT_SKIP;
^---- Returning a value in a void function?
----8<----