[LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels

Vasileios Almpanis vasileios.almpanis@virtuozzo.com
Mon Mar 30 12:20:25 CEST 2026


The default checkpoint wake/wait budget is 10s. Pagecache setup plus fsync
across several filesystems can exceed that on KASAN, lockdep, or otherwise
slow configs. Parents then fail checkpoint wait or wake, children stay in
leaf cgroups, and framework cgroup teardown hits EBUSY.

Use tst_multiply_timeout(10) * 1000 ms for CHILD_IDLE / TEST_DONE waits,
the matching CHILD_IDLE wake, and TEST_DONE wake in cleanup so timeouts
follow LTP_TIMEOUT_MUL and slow-kernel scaling like other tests.

Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
---
 testcases/kernel/controllers/memcg/memcontrol03.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/controllers/memcg/memcontrol03.c b/testcases/kernel/controllers/memcg/memcontrol03.c
index 493e970ab..5820621e1 100644
--- a/testcases/kernel/controllers/memcg/memcontrol03.c
+++ b/testcases/kernel/controllers/memcg/memcontrol03.c
@@ -41,6 +41,7 @@
 #include "memcontrol_common.h"
 
 #define TMPDIR "mntdir"
+#define CHECKPOINT_TIMEOUT_MS (tst_multiply_timeout(10) * 1000)
 
 static struct tst_cg_group *trunk_cg[3];
 static struct tst_cg_group *leaf_cg[4];
@@ -72,8 +73,9 @@ static void cleanup_sub_groups(void)
 		if (!leaf_cg[i - 1])
 			continue;
 
-		TST_CHECKPOINT_WAKE2(TEST_DONE,
-				     ARRAY_SIZE(leaf_cg) - 1);
+		TST_CHECKPOINT_WAKE2_TIMEOUT(TEST_DONE,
+					     ARRAY_SIZE(leaf_cg) - 1,
+					     CHECKPOINT_TIMEOUT_MS);
 		tst_reap_children();
 		break;
 	}
@@ -140,7 +142,7 @@ static void alloc_pagecache_in_child(const struct tst_cg_group *const cg,
 	size_t cgmem;
 
 	if (pid) {
-		TST_CHECKPOINT_WAIT(CHILD_IDLE);
+		TST_CHECKPOINT_WAIT2(CHILD_IDLE, CHECKPOINT_TIMEOUT_MS);
 		return;
 	}
 
@@ -155,9 +157,8 @@ static void alloc_pagecache_in_child(const struct tst_cg_group *const cg,
 		alloc_pagecache(fd, size);
 
 	SAFE_FSYNC(fd);
-
-	TST_CHECKPOINT_WAKE(CHILD_IDLE);
-	TST_CHECKPOINT_WAIT(TEST_DONE);
+	TST_CHECKPOINT_WAKE_TIMEOUT(CHILD_IDLE, CHECKPOINT_TIMEOUT_MS);
+	TST_CHECKPOINT_WAIT2(TEST_DONE, CHECKPOINT_TIMEOUT_MS);
 	exit(0);
 }
 
-- 
2.43.0



More information about the ltp mailing list