All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] starvation: honor -t instead of calibrating
@ 2026-08-21  5:53 Victor Cheng-Yen Yang via ltp
  2026-08-21  6:54 ` [LTP] " linuxtestproject.agent
  0 siblings, 1 reply; 2+ messages in thread
From: Victor Cheng-Yen Yang via ltp @ 2026-08-21  5:53 UTC (permalink / raw)
  To: ltp

tst_parse_int() returns 0 both when the option is absent and when it
parses successfully, so its return value cannot distinguish the two.

Use the zero-initialized timeout as the "not set" sentinel and skip
calibration entirely when -t is supplied correctly.

Signed-off-by: Victor Cheng-Yen Yang <cyyang772@andestech.com>
---
 testcases/kernel/sched/cfs-scheduler/starvation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/sched/cfs-scheduler/starvation.c b/testcases/kernel/sched/cfs-scheduler/starvation.c
index 045254ba4..ff041bdcd 100644
--- a/testcases/kernel/sched/cfs-scheduler/starvation.c
+++ b/testcases/kernel/sched/cfs-scheduler/starvation.c
@@ -107,7 +107,8 @@ static void setup(void)
 
 	if (tst_parse_int(str_timeout, &timeout, 1, INT_MAX))
 		tst_brk(TBROK, "Invalid number of timeout '%s'", str_timeout);
-	else
+
+	if (!timeout)
 		timeout = callibrate() / 1000;
 
 	if (tst_has_slow_kconfig())
-- 
2.34.1


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

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

end of thread, other threads:[~2026-08-21  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21  5:53 [LTP] [PATCH] starvation: honor -t instead of calibrating Victor Cheng-Yen Yang via ltp
2026-08-21  6:54 ` [LTP] " linuxtestproject.agent

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.