[LTP] [PATCH v2] hugepages: make compact_memory setup optional
Andrea Cervesato <[email protected]>
| Newsgroups | it.linux.lists.ltp |
|---|---|
| Message-ID | <[email protected]> |
From: Andrea Cervesato <[email protected]> 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 <[email protected]> Suggested-by: Li Wang <[email protected]> --- 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/[email protected] --- 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 <[email protected]> -- Mailing list info: https://lists.linux.it/listinfo/ltp