Identifying and eliminating latency sources on your hardware platform.
Real-Time Linux
Real-Time Linux and Preempt-RT.
Real-Time and Linux
A real-time operating system is designed to ensure that real-time tasks can be executed within defined deadlines. This does not mean executing a task as fast as possible, but ensuring that it receives the CPU resources it needs within its required deadline. These deadlines are application-dependent, ranging from minutes in water treatment systems to microseconds in robotics. Missing them can cause malfunction or fatal consequences. While standard Linux systems do provide excellent throughput, they do not guarantee real-time scheduling behavior.
Preempt-RT was merged into the mainline Linux kernel in 2024, after two decades of development. Linutronix engineers created Preempt-RT and continue to maintain it upstream today. It is deployed across a broad range of hardware platforms and industrial environments worldwide. Depending on the hardware platform, support response times well below 100 microseconds are achievable.
Worst-case latency under load
Vanilla Kernel
21.5 ms
PREEMPT_RT
40 µs
Why Preempt-RT
Without Preempt-RT, the Linux kernel has multiple sections where preemption is disabled:
- Spinlock-protected regions
- Interrupt handlers
- Portions of the scheduler
Such sections introduce unbounded latency for real-time tasks that need to be scheduled on the CPU to meet their deadline.
Preempt-RT addresses this mainly by:
- Converting spinlocks into preemptible, sleeping locks implemented via
rtmutex - Turning interrupt handlers into preemptible kernel threads, which by default run under the
SCHED_FIFOscheduling policy at priority 50 (MAX_RT_PRIO/ 2), midway between the minimum and maximum real-time priorities - Using high-resolution hardware timers with nanosecond precision in the kernel timer subsystem
- Applying priority inheritance to prevent priority inversion across lock chains
This results in a kernel where a real-time task can preempt almost any other kernel code path, thus getting it scheduled on the CPU before its deadline expires.
Worst-case wake-up latency on modern hardware is typically in the range of 20–50 microseconds, depending on the SoC, interrupt load, and configuration.
Preempt-RT over the years
From its roots in academic real-time research to its 2024 merge into the mainline kernel, PREEMPT_RT’s development spans more than two decades:
CONFIG_PREEMPT_RTIntegration with Other Technologies
Real-Time Linux does not stand alone in embedded system design:
- Hypervisor setups — Preempt-RT can run inside a dedicated VM with pinned CPU cores and hardware-assigned peripherals. Jailhouse and other hypervisors support this configuration for mixed-criticality systems.
- Industrial networking — Preempt-RT combines with TSN so real-time scheduling and deterministic network transport work together end to end.
- Safety and certification — Preempt-RT can be used as part of safety-oriented system architectures, together with suitable hardware, software, development processes, and verification activities.
- Real-time applications — Preempt-RT enables deterministic Linux-based control and processing for applications such as robotics, motion control, PLCs, automotive systems, and machine vision, where predictable response times matter more than maximum throughput.
Work with us on Real-Time Linux
Linutronix engineers created Preempt-RT, and for over 20 years, continue to develop and maintain it upstream. Our team covers latency analysis, BSP development, kernel configuration, and production validation:
Latency analysis
Training
All around Preempt-RT, including special Real-Time Linux training weeks.
Upstreaming
Contributing platform support and fixes to mainline Linux.
Testing
Real-time benchmarks for full hardware/software deployments.