All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] hugepages: ensure CONFIG_COMPACTION is defined
@ 2026-07-17  6:29 Andrea Cervesato
  2026-07-17  6:49 ` Andrea Cervesato via ltp
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrea Cervesato @ 2026-07-17  6:29 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

Add check to ensure CONFIG_COMPACTION=y when we need to use hugepages
inside tests. The kernel configuration is used to enable usage of
`/proc/sys/vm/compact_memory` inside the LTP core library.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
The issue was raised by https://github.com/linux-test-project/ltp/pull/1335
that is trying to solve a problem with cachestat03.
---
 lib/tst_hugepage.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/tst_hugepage.c b/lib/tst_hugepage.c
index 40ecfa162a236a8674628f8ffe7a8fd2ccd52712..8fba466b0ebb04d43542d686d6bb9173f1a14cb8 100644
--- a/lib/tst_hugepage.c
+++ b/lib/tst_hugepage.c
@@ -46,6 +46,11 @@ unsigned long tst_reserve_hugepages(struct tst_hugepage *hp)
 		goto set_hugepages;
 	}
 
+	if (access(PATH_VM_COMPACT_MEMORY, F_OK)) {
+		if (hp->policy == TST_NEEDS || hp->policy == TST_REQUEST)
+			tst_brk(TCONF, "CONFIG_COMPACTION not enabled in kernel");
+	}
+
 	SAFE_FILE_PRINTF(PATH_VM_DROP_CACHES, "3");
 	SAFE_FILE_PRINTF(PATH_VM_COMPACT_MEMORY, "1");
 	if (hp->policy == TST_NEEDS) {

---
base-commit: d6fe8d8e7a58c83b6a192fb27cd2ecf5249182f7
change-id: 20260717-fix_tst_test_hugepages-fb3c88e9716c

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-17  9:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  6:29 [LTP] [PATCH] hugepages: ensure CONFIG_COMPACTION is defined Andrea Cervesato
2026-07-17  6:49 ` Andrea Cervesato via ltp
2026-07-17  7:36 ` Li Wang
2026-07-17  7:45   ` Andrea Cervesato via ltp
2026-07-17  7:48   ` Cyril Hrubis
2026-07-17  9:34     ` Petr Vorel
2026-07-17  9:32 ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.