User Tools

Site Tools


realtime:documentation:howto:tools:cyclictest:options:priority

Cyclictest - Thread real-time priority

The Cyclictest priority option (–priority) determines the real-time priority of Cyclictest's latency measuring threads. This option should always be used when running a test.

There are a few things to keep in mind when specifying Cyclictest's priority option. Firstly, the priority of Cyclictest's measuring threads needs to be lower than the priority of whatever is producing the latency that is to be measured. The priority of the measuring thread needs to be lower so that when its timer expires it will be executed after what is producing the latency and therefore be able to detect the latency. Additionally, the priority of the measuring threads should be higher than all tasks whose latencies are not supposed to be measured. The measuring thread's priority needs to be higher than these so that the measuring thread executes before them and therefore is not delayed by them.

By default, Cyclictest gives different real-time priorities to each thread. On a symmetric multi-processing (SMP) system, the option –smp can be used to give all threads the same priority. However, this is not the only effect that the SMP option has.


Measuring system latencies

If latencies caused by the hardware, the firmware, and the OS are being measured, then Cyclictest's priority should be higher than the priority of the application or load that is executing on the platform. If Cyclictest's priority is not higher, then the measured system latency times will be longer than reality because other userspace tasks will be able to execute before the Cyclictest measuring threads have a chance to execute in response to their timer expiries.

Measuring application latencies

If Cyclictest is being used to approximate the latency of RT userspace tasks, then the measuring threads' priority needs to be lower than the priority of the tasks which are producing the latencies that Cyclictest is supposed to be detecting. The thread's priority also needs to be higher than the lower priority tasks which are producing latencies that are not supposed to be measured. This will ensure that Cyclictest only measures the latencies experienced by the higher priority tasks whose latencies are supposed to be measured.

For example, if Task A (high priority) and Task B (low priority) are running on a system and the intention is to measure the influence of Task A on the latencies experienced by Task B, then Cyclictest's priority should be lower than Task A's but higher than Task B's. The Cyclictest measuring threads should have a lower priority than Task A so that they execute after this task and are affected by the additional latencies it causes. However, their priority should be lower than Task B's so that they execute before it and are not influenced by Task B.

realtime/documentation/howto/tools/cyclictest/options/priority.txt · Last modified: 2018/08/21 12:43 by ebugden