[PATCH] controllers/cpuacct_task: Increase execution time to 100ms

Wake Liu via ltp <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
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 <[email protected]>
---
 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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.