[LTP] [PATCH] controllers/cpuacct_task: Increase execution time to 100ms
Wake Liu
wakel@google.com
Mon Aug 10 05:39:21 CEST 2026
The test helper cpuacct_task currently runs for 10ms (virtual time)
before exiting. On some systems (e.g. fast virtual machines or under
heavy load), this short duration can lead to 0 usage being recorded in
cpuacct.usage cgroup file due to timing resolution or scheduling delay.
Increase the execution time to 100ms to ensure that the process runs
long enough to register a non-zero CPU usage, reducing flakiness of the
test.
Signed-off-by: Wake Liu <wakel@google.com>
---
testcases/kernel/controllers/cpuacct/cpuacct_task.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/controllers/cpuacct/cpuacct_task.c b/testcases/kernel/controllers/cpuacct/cpuacct_task.c
index 677d6d401..9519bd9b3 100644
--- a/testcases/kernel/controllers/cpuacct/cpuacct_task.c
+++ b/testcases/kernel/controllers/cpuacct/cpuacct_task.c
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
return 1;
}
- struct itimerval it = {.it_value = {.tv_sec = 0, .tv_usec = 10000}};
+ struct itimerval it = {.it_value = {.tv_sec = 0, .tv_usec = 100000}};
setitimer(ITIMER_VIRTUAL, &it, NULL);
for (;;);
--
2.55.0.654.g21b8a5bc05-goog
More information about the ltp
mailing list