Back to articles
How-ToSystems

Measuring Jitter: Standard Linux vs PREEMPT_RT under heavy load

via Reddit Programming/u/Special_Ad5912

I've been working on a Software PLC where microsecond-level execution timing is critical. To guarantee real-time performance, I tested and compared the scheduling jitter between a standard Linux kernel and a PREEMPT_RT patched kernel (Ubuntu 24.04). The Setup: A C++ task waking up every 10ms using clock_nanosleep , running for 10,000 iterations. Applied heavy system load using stress-ng (CPU 100%, Disk I/O, Context switches, Page faults). CPU governor set to 'performance'. The Results (Worst-case Jitter): Standard Linux Kernel: Extremely unpredictable. Jitter spiked up to ~650 µs when the system was under stress. PREEMPT_RT Kernel: Very stable. The worst-case jitter was strictly bounded under 70 µs . It's impressive how much stability the PREEMPT_RT patch brings to a general-purpose OS without needing a dedicated RTOS. I also learned a hard lesson about not doing File I/O inside an RT loop the hard way! 😅 Any feedback or tips on further tuning (like IRQ Affinity) would be greatly appre

Continue reading on Reddit Programming

Opens in a new tab

Read Full Article
0 views

Related Articles