Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] hugepages: make compact_memory setup optional
@ 2026-07-17  8:02 Andrea Cervesato
  2026-07-17  8:09 ` Li Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrea Cervesato @ 2026-07-17  8:02 UTC (permalink / raw)
  To: Linux Test Project

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

Writing 1 to /proc/sys/vm/compact_memory only triggers proactive
memory compaction. It's a best-effort hint that makes a hugepage
reservation more likely to succeed by defragmenting memory
beforehand, but the reservation itself does not depend on it.

The kernel can (and often will) still satisfy the request without
any explicit compaction step. So treating a missing compact_memory
(i.e. CONFIG_COMPACTION=n) as a hard TCONF is too strict: it skips
tests that could otherwise run perfectly fine.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
Suggested-by: Li Wang <li.wang@linux.dev>
---
The issue was raised by https://github.com/linux-test-project/ltp/pull/1335
that is trying to solve a problem with cachestat03.
---
Changes in v2:
- change the patch with Li suggestion and description
- Link to v1: https://lore.kernel.org/20260717-fix_tst_test_hugepages-v1-1-a63bf2ccdd17@suse.com
---
 lib/tst_hugepage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_hugepage.c b/lib/tst_hugepage.c
index 40ecfa162a236a8674628f8ffe7a8fd2ccd52712..d5e1650d2ae65eaede662af9a2435fea2d3ef61f 100644
--- a/lib/tst_hugepage.c
+++ b/lib/tst_hugepage.c
@@ -47,7 +47,7 @@ unsigned long tst_reserve_hugepages(struct tst_hugepage *hp)
 	}
 
 	SAFE_FILE_PRINTF(PATH_VM_DROP_CACHES, "3");
-	SAFE_FILE_PRINTF(PATH_VM_COMPACT_MEMORY, "1");
+	FILE_PRINTF(PATH_VM_COMPACT_MEMORY, "1");
 	if (hp->policy == TST_NEEDS) {
 		tst_hugepages += SAFE_READ_MEMINFO("HugePages_Total:");
 		goto set_hugepages;

---
base-commit: b8eb2e087e13eb85c9a77baa3fb3533eedd55098
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] 4+ messages in thread

* Re: [LTP] [PATCH v2] hugepages: make compact_memory setup optional
  2026-07-17  8:02 [LTP] [PATCH v2] hugepages: make compact_memory setup optional Andrea Cervesato
@ 2026-07-17  8:09 ` Li Wang
  2026-07-17  8:47 ` Cyril Hrubis
  2026-07-17  9:04 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2026-07-17  8:09 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Reviewed-by: Li Wang <li.wang@linux.dev>

-- 
Regards,
Li Wang

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

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

* Re: [LTP] [PATCH v2] hugepages: make compact_memory setup optional
  2026-07-17  8:02 [LTP] [PATCH v2] hugepages: make compact_memory setup optional Andrea Cervesato
  2026-07-17  8:09 ` Li Wang
@ 2026-07-17  8:47 ` Cyril Hrubis
  2026-07-17  9:04 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2026-07-17  8:47 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v2] hugepages: make compact_memory setup optional
  2026-07-17  8:02 [LTP] [PATCH v2] hugepages: make compact_memory setup optional Andrea Cervesato
  2026-07-17  8:09 ` Li Wang
  2026-07-17  8:47 ` Cyril Hrubis
@ 2026-07-17  9:04 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-17  9:04 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  8:02 [LTP] [PATCH v2] hugepages: make compact_memory setup optional Andrea Cervesato
2026-07-17  8:09 ` Li Wang
2026-07-17  8:47 ` Cyril Hrubis
2026-07-17  9:04 ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox