Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] clock_gettime03: Extend tolerance on slow kernel configs
@ 2026-07-31  7:15 Wake Liu via ltp
  2026-07-31  7:59 ` Andrea Cervesato via ltp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wake Liu via ltp @ 2026-07-31  7:15 UTC (permalink / raw)
  To: ltp; +Cc: Wake Liu

Debugging/instrumentation kernel configs (like KASAN, LOCKDEP, etc.)
can significantly degrade performance, causing the time namespace
offset checks to exceed the default 10ms tolerance.

Use tst_has_slow_kconfig() to detect these slow configurations and
multiply the delta tolerance by 10, preventing false test failures
on slow/debug kernels.

Signed-off-by: Wake Liu <wakel@google.com>
---
 testcases/kernel/syscalls/clock_gettime/clock_gettime03.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c b/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
index 495030c07e..665a1107b8 100644
--- a/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
+++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
@@ -16,6 +16,7 @@
 #include "time64_variants.h"
 #include "tst_safe_clocks.h"
 #include "tst_timer.h"
+#include "tst_kconfig.h"
 #include "lapi/sched.h"
 
 static struct tcase {
@@ -117,6 +118,11 @@ static void setup(void)
 		delta *= 10;
 	}
 
+	if (tst_has_slow_kconfig()) {
+		tst_res(TINFO, "Slow kernel config detected, multiply the delta by 10.");
+		delta *= 10;
+	}
+
 	now.type = then.type = parent_then.type = tv->ts_type;
 	tst_res(TINFO, "Testing variant: %s", variants[tst_variant].desc);
 	parent_ns = SAFE_OPEN("/proc/self/ns/time_for_children", O_RDONLY);
-- 
2.55.0.508.g3f0d502094-goog


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

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

end of thread, other threads:[~2026-07-31 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  7:15 [LTP] [PATCH] clock_gettime03: Extend tolerance on slow kernel configs Wake Liu via ltp
2026-07-31  7:59 ` Andrea Cervesato via ltp
2026-07-31  9:45 ` [LTP] " linuxtestproject.agent
2026-07-31 10:21 ` [LTP] [PATCH] " 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