$linuxjunkies
>

PREEMPT_RT

also: RT patch, PREEMPT_RT patch, Real-Time Linux

PREEMPT_RT is a Linux kernel patch set that enables hard real-time capabilities by making the kernel fully preemptible, allowing time-critical tasks to interrupt almost any kernel operation with minimal latency.

PREEMPT_RT (Real-Time) is a set of patches that converts the Linux kernel into a real-time system by replacing spinlocks with mutexes and making nearly all kernel code preemptible. This allows high-priority tasks to interrupt kernel operations without waiting for them to complete, reducing maximum latency (jitter) to predictable, microsecond-level ranges.

Without PREEMPT_RT, standard Linux prioritizes throughput over predictability—high-priority processes may wait for lower-priority ones to finish their kernel work. PREEMPT_RT flips this by ensuring critical threads get CPU time within guaranteed time bounds, essential for applications like industrial control, robotics, and audio processing.

Example: A real-time audio application using PREEMPT_RT can guarantee it processes sound data every 1ms without interruption, whereas standard Linux might occasionally miss this deadline due to kernel locking. The patch set has been gradually integrated into the mainline kernel since Linux 5.9 and is commonly built as a separate RT kernel image.

Related terms