Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sched: starvation: Autocallibrate the timeout
Instead of hardcoding the values we attempt to measure the CPU speed and set the runtime accordingly. Given that the difference in the duration of the test when the kernel is buggy is about 30x we do not have to have a precise callibration, just very rough estimate if we are running on a server or small ARM board would suffice. So we attempt to measure how long does a bussy loop take and base the default timeout on that. On x86_64 CPUs the resulting runtime seems to be between 2x and 10x of the actual runtime which seems to be in the required range. We also make sure to check the runtime at the end of the test because the failures could have been masked by a timeout multiplier, i.e. if you set LTP_TIMEOUT_MUL=10 the test would previously pass on a buggy kernel as well. The side efect is that we now get better PASS/FAIL messages as well. Signed-off-by: Cyril Hrubis <[email protected]> Reviewed-by: Petr Vorel <[email protected]> Tested-by: Petr Vorel <[email protected]> Tested-by: Anders Roxell <[email protected]>
- Loading branch information