* [LTP] [PATCH 0/2] configurable wake timeout and memcontrol03 fixes @ 2026-03-30 10:20 Vasileios Almpanis via ltp 2026-03-30 10:20 ` [LTP] [PATCH 1/2] lib/checkpoint: add configurable timeout for checkpoint wake Vasileios Almpanis via ltp 2026-03-30 10:20 ` [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels Vasileios Almpanis via ltp 0 siblings, 2 replies; 9+ messages in thread From: Vasileios Almpanis via ltp @ 2026-03-30 10:20 UTC (permalink / raw) To: ltp Parents and children in memcontrol03 coordinate with very tight timeout budget(10s) which ofter leads to timeout fails in slow configs. The first patch extends tst_safe_checkpoint_wake() with an explicit millisecond timeout; 0 keeps the previous 10s default. It adds TST_CHECKPOINT_WAKE_TIMEOUT / TST_CHECKPOINT_WAKE2_TIMEOUT macros so tests don't have to change existing TST_CHECKPOINT_WAKE* call sites. The second patch uses tst_multiply_timeout(10) * 1000 for the checkpoint waits and wakes in memcontrol03.c, including cleanup, so those budgets track LTP_TIMEOUT_MUL. Vasileios Almpanis (2): lib/checkpoint: add configurable timeout for checkpoint wake memcg: scale memcontrol03 checkpoint timeouts for slow kernels include/tst_checkpoint.h | 41 ++++++++++++++++--- include/tst_checkpoint_fn.h | 2 +- lib/tst_checkpoint.c | 9 +++- .../kernel/controllers/memcg/memcontrol03.c | 13 +++--- 4 files changed, 51 insertions(+), 14 deletions(-) -- 2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH 1/2] lib/checkpoint: add configurable timeout for checkpoint wake 2026-03-30 10:20 [LTP] [PATCH 0/2] configurable wake timeout and memcontrol03 fixes Vasileios Almpanis via ltp @ 2026-03-30 10:20 ` Vasileios Almpanis via ltp 2026-04-02 9:57 ` [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() Vasileios Almpanis via ltp 2026-03-30 10:20 ` [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels Vasileios Almpanis via ltp 1 sibling, 1 reply; 9+ messages in thread From: Vasileios Almpanis via ltp @ 2026-03-30 10:20 UTC (permalink / raw) To: ltp tst_safe_checkpoint_wake() always used DEFAULT_MSEC_TIMEOUT (10s) for tst_checkpoint_wake(), which is too short when parents wait much longer (e.g. slow storage, KASAN, lockdep) while children allocate memory before they reach the matching checkpoint wait. Extend tst_safe_checkpoint_wake(..., msec_timeout) so callers can pass an explicit millisecond budget; msec_timeout 0 preserves the previous 10s default. Add TST_CHECKPOINT_WAKE_TIMEOUT and TST_CHECKPOINT_WAKE2_TIMEOUT macros. Existing TST_CHECKPOINT_WAKE*, TST_CHECKPOINT_WAKE2, and TST_CHECKPOINT_WAKE_AND_WAIT pass 0 for the new argument so behavior is unchanged unless tests opt in. Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com> --- include/tst_checkpoint.h | 41 ++++++++++++++++++++++++++++++++----- include/tst_checkpoint_fn.h | 2 +- lib/tst_checkpoint.c | 9 ++++++-- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/include/tst_checkpoint.h b/include/tst_checkpoint.h index f202dd03d..36089c1c5 100644 --- a/include/tst_checkpoint.h +++ b/include/tst_checkpoint.h @@ -57,7 +57,7 @@ * was reached the function calls tst_brk(TBROK, ...) which exits the test. */ #define TST_CHECKPOINT_WAKE(id) \ - tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, 1) + tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, 1, 0) /** * TST_CHECKPOINT_WAKE2() - Wakes up several checkpoints. @@ -66,13 +66,44 @@ * @nr_wake: A number of processes to wake. * * Wakes up nr_wake processes suspended on a checkpoint and retries if there - * wasn't enough process suspended on the checkpoint yet. The call does not + * weren't enough processes suspended on the checkpoint yet. The call does not * retry indefinitely but gives up if it does not wake nr_wake processes after * 10 seconds. If an error happened or timeout was reached the function calls * tst_brk(TBROK, ...) which exits the test. */ #define TST_CHECKPOINT_WAKE2(id, nr_wake) \ - tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, nr_wake) + tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, nr_wake, 0) + +/** + * TST_CHECKPOINT_WAKE_TIMEOUT() - Wakes up a checkpoint. + * + * @id: A checkpoint id a positive integer. + * @msec_timeout: A timeout. + * + * Wakes up a process suspended on a checkpoint and retries if there is no + * process suspended on the checkpoint yet. The call does not retry + * indefinitely but gives up if it does not wake a process after the timeout. + * If an error happened or timeout was reached the function calls + * tst_brk(TBROK, ...) which exits the test. + */ +#define TST_CHECKPOINT_WAKE_TIMEOUT(id, msec_timeout) \ + tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, 1, msec_timeout) + +/** + * TST_CHECKPOINT_WAKE2_TIMEOUT() - Wakes up several checkpoints. + * + * @id: A checkpoint id a positive integer. + * @nr_wake: A number of processes to wake. + * @msec_timeout: A timeout. + * + * Wakes up nr_wake processes suspended on a checkpoint and retries if there + * weren't enough processes suspended on the checkpoint yet. The call does not + * retry indefinitely but gives up if it does not wake nr_wake processes after + * the timeout. If an error happened or timeout was reached the function calls + * tst_brk(TBROK, ...) which exits the test. + */ +#define TST_CHECKPOINT_WAKE2_TIMEOUT(id, nr_wake, msec_timeout) \ + tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, nr_wake, msec_timeout) /** * TST_CHECKPOINT_WAKE_AND_WAIT() - Wakes up a checkpoint and immediately waits on it. @@ -82,8 +113,8 @@ * This is a combination of TST_CHECKPOINT_WAKE() and TST_CHECKPOINT_WAIT(). */ #define TST_CHECKPOINT_WAKE_AND_WAIT(id) do { \ - tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, 1); \ - tst_safe_checkpoint_wait(__FILE__, __LINE__, NULL, id, 0); \ + tst_safe_checkpoint_wake(__FILE__, __LINE__, NULL, id, 1, 0); \ + tst_safe_checkpoint_wait(__FILE__, __LINE__, NULL, id, 0); \ } while (0) #endif /* TST_CHECKPOINT__ */ diff --git a/include/tst_checkpoint_fn.h b/include/tst_checkpoint_fn.h index e061e00b9..13196b323 100644 --- a/include/tst_checkpoint_fn.h +++ b/include/tst_checkpoint_fn.h @@ -30,6 +30,6 @@ void tst_safe_checkpoint_wait(const char *file, const int lineno, void tst_safe_checkpoint_wake(const char *file, const int lineno, void (*cleanup_fn)(void), unsigned int id, - unsigned int nr_wake); + unsigned int nr_wake, unsigned int msec_timeout); #endif /* TST_CHECKPOINT_FN__ */ diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c index f2faf6563..b9e6443e0 100644 --- a/lib/tst_checkpoint.c +++ b/lib/tst_checkpoint.c @@ -100,9 +100,14 @@ void tst_safe_checkpoint_wait(const char *file, const int lineno, void tst_safe_checkpoint_wake(const char *file, const int lineno, void (*cleanup_fn)(void), unsigned int id, - unsigned int nr_wake) + unsigned int nr_wake, unsigned int msec_timeout) { - int ret = tst_checkpoint_wake(id, nr_wake, DEFAULT_MSEC_TIMEOUT); + int ret; + + if (!msec_timeout) + msec_timeout = DEFAULT_MSEC_TIMEOUT; + + ret = tst_checkpoint_wake(id, nr_wake, msec_timeout); if (ret) { tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, -- 2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() 2026-03-30 10:20 ` [LTP] [PATCH 1/2] lib/checkpoint: add configurable timeout for checkpoint wake Vasileios Almpanis via ltp @ 2026-04-02 9:57 ` Vasileios Almpanis via ltp 2026-04-02 12:52 ` Cyril Hrubis 0 siblings, 1 reply; 9+ messages in thread From: Vasileios Almpanis via ltp @ 2026-04-02 9:57 UTC (permalink / raw) To: ltp Apply tst_multiply_timeout() to millisecond timeouts in tst_checkpoint_wait() and tst_checkpoint_wake() so checkpoint delays respect LTP_TIMEOUT_MUL and slow-kernel scaling, consistent with other LTP timeouts. Declare tst_multiply_timeout() in this file instead of including tst_test.h, which conflicts with the legacy test.h include used by libltp. v2: - Dropped second patch of the series and applied tst_multiply_timeout directly in the checkpoint library to hide it from the tests. - Reverted extra timeout argument from tst_checkpoint_wake. - Dropped new defines with timeout - Added tst_multiply_timeout inside tst_checkpoint_{wait/wake} Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com> --- lib/tst_checkpoint.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c index f2faf6563..33db08380 100644 --- a/lib/tst_checkpoint.c +++ b/lib/tst_checkpoint.c @@ -15,6 +15,8 @@ #define DEFAULT_MSEC_TIMEOUT 10000 +unsigned int tst_multiply_timeout(unsigned int timeout); + /* * Global futex array and size for checkpoint synchronization. * @@ -37,6 +39,8 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout) return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + timeout.tv_sec = msec_timeout/1000; timeout.tv_nsec = (msec_timeout%1000) * 1000000; @@ -61,6 +65,8 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake, return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + for (;;) { waked += syscall(SYS_futex, &tst_futexes[id], FUTEX_WAKE, INT_MAX, NULL); -- 2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() 2026-04-02 9:57 ` [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() Vasileios Almpanis via ltp @ 2026-04-02 12:52 ` Cyril Hrubis 2026-04-02 20:11 ` Petr Vorel 0 siblings, 1 reply; 9+ messages in thread From: Cyril Hrubis @ 2026-04-02 12:52 UTC (permalink / raw) To: Vasileios Almpanis; +Cc: ltp 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] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() 2026-04-02 12:52 ` Cyril Hrubis @ 2026-04-02 20:11 ` Petr Vorel 2026-04-08 8:44 ` Li Wang via ltp 0 siblings, 1 reply; 9+ messages in thread From: Petr Vorel @ 2026-04-02 20:11 UTC (permalink / raw) To: Cyril Hrubis; +Cc: Vasileios Almpanis, ltp Hi all, > Hi! > Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Suggested-by: Cyril Hrubis <chrubis@suse.cz> Reviewed-by: Petr Vorel <pvorel@suse.cz> This is really way better than the original approach: https://patchwork.ozlabs.org/project/ltp/list/?series=497995&state=* Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() 2026-04-02 20:11 ` Petr Vorel @ 2026-04-08 8:44 ` Li Wang via ltp 0 siblings, 0 replies; 9+ messages in thread From: Li Wang via ltp @ 2026-04-08 8:44 UTC (permalink / raw) To: Petr Vorel, vasileios.almpanis; +Cc: Vasileios Almpanis, ltp On Thu, Apr 02, 2026 at 10:11:29PM +0200, Petr Vorel wrote: > Hi all, > > > Hi! > > Reviewed-by: Cyril Hrubis <chrubis@suse.cz> > > Suggested-by: Cyril Hrubis <chrubis@suse.cz> > Reviewed-by: Petr Vorel <pvorel@suse.cz> > > This is really way better than the original approach: Agreed and merged this, thanks! -- Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels 2026-03-30 10:20 [LTP] [PATCH 0/2] configurable wake timeout and memcontrol03 fixes Vasileios Almpanis via ltp 2026-03-30 10:20 ` [LTP] [PATCH 1/2] lib/checkpoint: add configurable timeout for checkpoint wake Vasileios Almpanis via ltp @ 2026-03-30 10:20 ` Vasileios Almpanis via ltp 2026-04-01 10:37 ` Cyril Hrubis 1 sibling, 1 reply; 9+ messages in thread From: Vasileios Almpanis via ltp @ 2026-03-30 10:20 UTC (permalink / raw) To: ltp 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 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels 2026-03-30 10:20 ` [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels Vasileios Almpanis via ltp @ 2026-04-01 10:37 ` Cyril Hrubis 2026-04-01 10:44 ` Cyril Hrubis 0 siblings, 1 reply; 9+ messages in thread From: Cyril Hrubis @ 2026-04-01 10:37 UTC (permalink / raw) To: Vasileios Almpanis; +Cc: ltp Hi! > +#define CHECKPOINT_TIMEOUT_MS (tst_multiply_timeout(10) * 1000) Wouldn't it make more sense to use the tst_multiply_timeout() directly in the checkpoint library and hide that complexity from the tests? -- Cyril Hrubis chrubis@suse.cz -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels 2026-04-01 10:37 ` Cyril Hrubis @ 2026-04-01 10:44 ` Cyril Hrubis 0 siblings, 0 replies; 9+ messages in thread From: Cyril Hrubis @ 2026-04-01 10:44 UTC (permalink / raw) To: Vasileios Almpanis; +Cc: ltp Hi! > > +#define CHECKPOINT_TIMEOUT_MS (tst_multiply_timeout(10) * 1000) > > Wouldn't it make more sense to use the tst_multiply_timeout() directly > in the checkpoint library and hide that complexity from the tests? If I'm not missing something it should be as easy as: diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c index f2faf6563..82f6ab87c 100644 --- a/lib/tst_checkpoint.c +++ b/lib/tst_checkpoint.c @@ -37,6 +37,8 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout) return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + timeout.tv_sec = msec_timeout/1000; timeout.tv_nsec = (msec_timeout%1000) * 1000000; @@ -61,6 +63,8 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake, return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + for (;;) { waked += syscall(SYS_futex, &tst_futexes[id], FUTEX_WAKE, INT_MAX, NULL); And with that ALL checkpoints timeouts will be increased on slow machines. -- Cyril Hrubis chrubis@suse.cz -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-04-08 8:45 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-30 10:20 [LTP] [PATCH 0/2] configurable wake timeout and memcontrol03 fixes Vasileios Almpanis via ltp 2026-03-30 10:20 ` [LTP] [PATCH 1/2] lib/checkpoint: add configurable timeout for checkpoint wake Vasileios Almpanis via ltp 2026-04-02 9:57 ` [LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout() Vasileios Almpanis via ltp 2026-04-02 12:52 ` Cyril Hrubis 2026-04-02 20:11 ` Petr Vorel 2026-04-08 8:44 ` Li Wang via ltp 2026-03-30 10:20 ` [LTP] [PATCH 2/2] memcg: scale memcontrol03 checkpoint timeouts for slow kernels Vasileios Almpanis via ltp 2026-04-01 10:37 ` Cyril Hrubis 2026-04-01 10:44 ` Cyril Hrubis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox