Understanding PREEMPT_RT (The Real-Time Patch) – ELCE 2012

> Linux, Programming, Video
> Understanding PREEMPT_RT (The Real-Time Patch) – ELCE 2012

Steven Rostedt, working at Red Hat, talks about Real-Time Linux at the Embedded Linux Conference Europe, in Spain on November 6, 2012.


The real-time patch (which provides CONFIG_PREEMPT_RT), has been around since 2005. Started by Ingo Molnar and maintained by Thomas Gleixner and several others, it has grown from a hobby RTOS into a very serious contender. Several distributions (Red Hat, SuSE, Debian, Ubuntu) supply a kernel version that includes this patch. The embedded world has started adding the -rt patch to their own devices that they ship. But do the embedded developers understand what the -rt patch supplies? Programming for real time, and especially when writing kernel code requires special knowledge to avoid real time traps. This talk will explain what the real time patch provides and special programming tips that will ensure embedded developers will get the best from their devices.

Real-Time Linux Option in Make menuconfig: “Fully Preemptible Kernel (RT)”

He goes through the following key points during the presentation:

  • Real-time OS definition – Deterministic, does not mean fast (but still nice), meet deadlines.
  • Goal of PREEMP_RT – 100% Preemptible kernel and quick reaction
  • Different levels of preemption in Linux:
    • No preemption – Do as most possible with as little scheduling overhead. Use for server in Linux 2.4
    • Voluntary preemption – Schedule only at “preemption points”
    • Preemptible Kernel – CONFIG_PREEMPT. Preempt anywhere except within spin_locks
    • Preemptible Kernel (Basic RT) – For debugging, it will most probably go away…
    • Fully Preemptible Kernel – PREEMPT_RT_FULL. Preempts everywhere except from preempt_disable and interrupts disabled.
  • Details of PREEMPT_RT in the Linux kernel – priorities, spin_locks, interrupts, threaded interrupts, etc…

You can also download the slides for this tutorial/presentation. You may also want to access the source code via the Git repo, or get the PREEMPT_RT patches at http://www.kernel.org/pub/linux/kernel/projects/rt/. Full details cane be found on the Real-Time Linux Wiki.