controllers/cpuacct_task: Increase execution time to 100ms
PATCH 1/1 controllers/cpuacct_task: Increase execution time to 100ms
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.
--- testcases/kernel/controllers/cpuacct/cpuacct_task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuacct/cpuacct_task.c +1 -1
@@ -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 (;;);
Signature · 5 lines
2.55.0.654.g21b8a5bc05-goog -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Wake,
testcases/kernel/controllers/cpuacct/cpuacct_task.c int main(int argc, char **argv) · line 65
Quoted 3 lines · Wake Liu
controllers/cpuacct_task: Increase execution time to 100ms
testcases/kernel/controllers/cpuacct/cpuacct_task.c +1
-0+struct itimerval it = {.it_value = {.tv_sec =0 , .tv_usec =100000 }};
Could this avoid increasing every helper's CPU time tenfold? The cpuacct_100_100 runtest case starts 10,000 helpers, so this requires at least 1,000 aggregate CPU seconds. The shell harness has a 300-second default timeout, which makes that case time out on systems restricted to three or fewer CPUs, before accounting for setup and process-management overhead.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp