How much Real-Time is enough: Comparison and Quantification of two Real Time Operating Systems (Masterthesis)


Nadja Peters

07.10.2013, 15:00, room 4981

Nowadays, operating systems can be found almost everywhere in the
world of embedded systems. Especially Real-Time Operating Systems
(RTOSes) have become popular for the efficient management of hardware
resources and complex user tasks. Dependent on the real-time
requirements, it can be a challenge to choose the right OS. Although
light-weight OSes like FreeRTOS provide the best real-time
performance, they include neither additional hardware drivers, the
ability to flexibly load applications nor features for performance
supervision. An open-source alternative is embedded Linux with RT
patch (LinuxRT). LinuxRT provides a large number of drivers and is
already widely used in embedded systems. Yet, due to its complexity,
real-time capability is considered an issue. To quantify the real-time
capability of LinuxRT, the OS is benchmarked in this work. FreeRTOS
which is considered to have a good real-time performance, is used as a
reference system. The comparison of the OSes is done by modeling the
latency of user applications. This latency contains a deterministic
part which is set up from the application code itself and
synchronization mechanisms provided by the OS. The other part is set
up from non-deterministic latencies like the timer tick or delays
caused by system daemons. Using the resulting formula, mean and
worst-case latencies can be estimated. Parameters for this formula are
obtained using tests related to the Rhealstone benchmark. The
benchmark contains typical parameters which classify the behavior of
RTOSes. These parameters are interrupt latency, task switching, the
time it takes to preempt a low priority task by a high-priority task,
task synchronization features (semaphores, message passing, event
signaling) and the time it takes to resolve priority inversion
conflicts. The fast interrupt handling is particularly important for
many real-time systems. Therefore, the interrupt latency in LinuxRT is
thoroughly tested in user and kernel mode, in idle state and by
applying load to the system. The latency of different application can
be estimated by inserting the obtained values into the model.

The results of this work provide a guideline on the LinuxRT
performance and give an insight on the weaknesses of the OS.
Especially the relative jitter is much higher than in FreeRTOS with
the timer tick as the main jitter factor. Although LinuxRT can handle
interrupts in ker-
nel mode very fast, the handling in user mode is significantly slower.
Yet, the jitter under load condition is only slightly worse than in
idle mode. Another weakness of LinuxRT is the POSIX priority
inheritance implementation. It degrades the performance significantly
compared to the other benchmark values. Generally speaking, LinuxRT
performs well for soft real-time applications, even when fast
throughput is required. This work shows where optimization would help
to improve performance.