All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wake Liu via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: Wake Liu <wakel@google.com>
Subject: [LTP] [PATCH] clock_gettime03: Extend tolerance on slow kernel configs
Date: Fri, 31 Jul 2026 07:15:45 +0000	[thread overview]
Message-ID: <20260731071545.1334046-1-wakel@google.com> (raw)

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

             reply	other threads:[~2026-07-31  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  7:15 Wake Liu via ltp [this message]
2026-07-31  7:59 ` [LTP] [PATCH] clock_gettime03: Extend tolerance on slow kernel configs Andrea Cervesato via ltp
2026-07-31  9:45 ` [LTP] " linuxtestproject.agent
2026-07-31 10:21 ` [LTP] [PATCH] " Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260731071545.1334046-1-wakel@google.com \
    --to=ltp@lists.linux.it \
    --cc=wakel@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.