hrimer-prio test
Hi,
I was looking into fails with the test ltp test hrtimer-prio.
For reference here is the test description:
----
Test the latency of hrtimers under rt load.
The busy_threads should run at a priority higher than the system softirq_hrtimer, but lower than the timer_thread. The timer_thread measure the time it takes to return from a nanosleep call. If the lower priority threads can increase the latency of the higher priority thread, it is considered a failure.
----
The test fails, repeatedly calls clock_nanosleep(10ms) and if the latency of one of these nanosleeps is longer than 10us, the test fails. The latency is measured using clock_gettime(CLOCK_MONOTONIC) In my test on x86_64 hardware, the test sometimes fails, but mostly passes. On an arm board it almost fails, sometimes with a minimal latency of > 30ms.
I have no knowledge of the timer subsystem, so I can't even tell if the test is (still) valid. The test is in ltp since 2007, but wasn't enabled until last year. So maybe the test is invalid and the expected latency is not even guaranteed anymore or does it require a specific kernel config or hardware (e.g. a high precision hardware timer)?
There is a kernel selftest for something similar (nsleep-lat). It only expects the average latency to be less than 40ms, but that has another difference, because it uses TIMER_ABSTIME instead of a relative sleep time.
Joerg
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Thomas,
I guess no one on the ltp mailing list can help here, maybe since you are maintainer of the hrtimer subsystem, maybe you can help.
Thanks,
Joerg
Am 2/11/2022 um 7:56 AM schrieb Joerg Vehlow:
Quoted 32 lines
Hi,
I was looking into fails with the test ltp test hrtimer-prio.
For reference here is the test description:
----
Test the latency of hrtimers under rt load.
Thebusy_threadsshould run at a priority higher than the systemsoftirq_hrtimer, but lower than thetimer_thread. Thetimer_threadmeasure the time it takes to return from a nanosleep call. If the lower priority threads can increase the latency of the higher priority thread, it is considered a failure.
----The test fails, repeatedly calls
clock_nanosleep(10ms)and if the latency of one of these nanosleeps is longer than 10us, the test fails. The latency is measured usingclock_gettime(CLOCK_MONOTONIC)In my test onx86_64hardware, the test sometimes fails, but mostly passes. On an arm board it almost fails, sometimes with a minimal latency of > 30ms.I have no knowledge of the timer subsystem, so I can't even tell if the test is (still) valid. The test is in ltp since 2007, but wasn't enabled until last year. So maybe the test is invalid and the expected latency is not even guaranteed anymore or does it require a specific kernel config or hardware (e.g. a high precision hardware timer)?
There is a kernel selftest for something similar (nsleep-lat). It only expects the average latency to be less than 40ms, but that has another difference, because it uses
TIMER_ABSTIMEinstead of a relative sleep time.Joerg
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp