[LTP] [PATCH v3] controllers/cpuacct: Dynamically adjust cpuacct_task execution time

Cyril Hrubis chrubis@suse.cz
Fri Aug 28 14:15:57 CEST 2026


Hi!
> 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,
> especially when running small configurations like cpuacct_1_1.

I was starting at the test for a while and I do not see how this could
happen.

The test uses ITMER_VIRTUAL which is counts user CPU time, so the kernel
guarantees that the loop would consume CPU for 10ms, regardless of the
CPU speed.

At the same time the cpuacct.sh script waits for all the processes
before it checks the usage counters. So under heavy load the test should
run longer but shouldn't fail.

All in all it should be guaranteed that the usage should be >= 10ms.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list