RTOS Modelling Naren Bala
Problem Want to know if we can design a real-time system using a given RTOS Expensive Simulation tools for popular RTOS performance metrics from some commercial RTOS vendors RTOS Modelling – estimate the overhead and computation time for the given problem Target RTOS – VxWorks Applicable to all RTOS
VxWorks features Tasks share memory Supports pre-emptive scheduling and round robin scheduling No concept of kernel space and user space Kernel clock – default of 60 Hz ~ 17 ms minimum and maximum values for kernel clock depending on target hardware
RTOS modelling Task set {Ti (period), Ci (WCET)} Priority Pi, Deadline Di response time Ri = Ci + Bi Overhead in using a RTOS
Measure Overhead High Precision measurements Requires timestamp drivers Timestamp driver – 40 ns VxWorks default timers – 17 ms to 100 μs
Overhead in RTOS Models Overhead in using a RTOS Task overhead Blocking overhead Pre-emptive Kernel overhead
Task Overhead Creation and deletion of tasks 44 μs 0.2 μs Allocation and deallocation of memory 0.72 μs 1.12 μs Context Switching 14 μs (2 empty tasks) 18 μs (loaded task) Interrupt Latency
Blocking Overhead Disable and re-enable interrupts < 100 ns < 100 ns Message queues Avg = 33 μs Stdev = 24 μs Semaphores (binary, mutex) 0.2 μs (take) 0.25 μs (release) Priority avoidance protocol 174 μs
Pre-emptive Kernel Blockage due to pre-emption Difficult to track the specific usage of time Easier to measure “idle time” Create an idle task with the lowest priority Kernel Timers not precise Require precise hardware timers for periodic tasks
Summary and Future Work VxWorks is fast and deterministic Same measurements can be easily repeated for most RTOS Evaluate LM Bench on VxWorks Need comparison with QNX, real-time Linux and Integrity Interrupt latency measurements using a logic analyzer or oscilloscope
References Windriver systems, Tornado User Guide Windriver systems, VxWorks Programmer Guide Windriver systems, BSP Developer Guide QNX Neutrino Real-time OS: Kernel Benchmark Methodology Real-Time Concepts for Embedded systems, Qing Li, Caroline Yao, 2003