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_FIFO scheduling 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:

1991First Linux kernel release
1996RTLinux released (New Mexico Institute of Technology)
1997KURT project founded (Kansas University Real Time, Prof. Douglas Niehaus, University of Kansas)
1998Linux/RK released (Carnegie Mellon)
1999KURT 2.0 released for Linux 2.2.5, the technical nucleus for Preempt-RT
1999RTAI released (Politecnico di Milano)
1999First Real-Time Linux Workshop in Vienna
2001KURT ported to Linux 2.4
2001XENOMAI project started
2004First release of the Preempt-RT patch
2005Generic interrupt subsystem
2006RT-mutexes, priority inheritance, PI-futex, mutexes, lockdep
2007Generic timekeeping, high resolution timers, NOHZ
2008Tracing infrastructure improvements
2009Preemptible RCU, threaded interrupts, raw spinlocks
2011The final Big Kernel Lock removal
2016Real-Time Linux Collaborative Project founded within the Linux Foundation
2018Treewide cleanup of locking
2019FPU, stacktrace, introduction of CONFIG_PREEMPT_RT
2020BPF support for RT
2021printk(), RT locking primitives, networking, memory
2024RT enabled on x86/ARM64 in Linux mainline — twenty years later

Integration 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

Identifying and eliminating latency sources on your hardware platform.

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.

Discuss your latency requirements