Thread (14 messages) 14 messages, 3 authors, 2026-05-26

Re: [PATCH v3 2/4] tools/lib/mm: move hugepage_settings out of selftests

From: Mike Rapoport <rppt@kernel.org>
Date: 2026-05-24 17:06:18
Also in: linux-kselftest, linux-mm, lkml

On Thu, 21 May 2026 16:47:59 +0530, Sarthak Sharma [off-list ref] wrote:

Hi Sarthak,
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/mm/hugepage_settings.c b/tools/lib/mm/hugepage_settings.c
similarity index 98%
rename from tools/testing/selftests/mm/hugepage_settings.c
rename to tools/lib/mm/hugepage_settings.c
index 5e947abb7425..b08b27776fc5 100644
--- a/tools/testing/selftests/mm/hugepage_settings.c
+++ b/tools/lib/mm/hugepage_settings.c
@@ -383,8 +387,6 @@ int detect_hugetlb_page_sizes(unsigned long sizes[], int max)
 		if (sscanf(entry->d_name, "hugepages-%zukB", &kb) != 1)
 			continue;
 		sizes[count++] = kb * 1024;
-		ksft_print_msg("[INFO] detected hugetlb page size: %zu KiB\n",
-			       kb);
I believe this message is useful for debugging.
quoted hunk ↗ jump to hunk
@@ -503,7 +505,6 @@ unsigned long hugetlb_setup(unsigned long nr, unsigned long sizes[],
 		return 0;
 
 	if (nr_enabled > max) {
-		ksft_print_msg("detected %d huge page sizes, will only test %d\n", nr_enabled, max);
And this one as well.
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
index de0633f9a7e5..7c58506c0aa7 100644
--- a/tools/testing/selftests/mm/compaction_test.c
+++ b/tools/testing/selftests/mm/compaction_test.c
@@ -15,9 +15,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
+#include <mm/hugepage_settings.h>
As with file_utils.h this can also go to vm_utils.h IMHO.

-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help