[LTP] [PATCH v2 1/1] lib: scale checkpoint wait/wake timeouts with tst_multiply_timeout()

Vasileios Almpanis vasileios.almpanis@virtuozzo.com
Thu Apr 2 11:57:39 CEST 2026


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



More information about the ltp mailing list