PREEMPT_RT specifics

CONFIG_PREEMPT_RT

  • The PREEMPT_RT patch adds a new level of preemption, called CONFIG_PREEMPT_RT_FULL
  • This level of preemption replaces all kernel spinlocks by mutexes (or so-called sleeping spinlocks)

    • Instead of providing mutual exclusion by disabling interrupts and preemption, they are just normal locks: when contention happens, the process is blocked and another one is selected by the scheduler.
    • Works well with threaded interrupts, since threads can block, while usual interrupt handlers could not.
    • Some core, carefully controlled, kernel spinlocks remain as normal spinlocks.
  • With CONFIG_PREEMPT_RT_FULL, virtually all kernel code becomes preemptible

    • An interrupt can occur at any time, when returning from the interrupt handler, the woken up process can start immediately.
  • This is the last big part of PREEMPT_RT that isn't fully in the mainline kernel yet
    • Part of it has been merged in 2.6.33: the spinlock annotations. The spinlocks that must remain as spinning spinlocks are now differentiated from spinlocks that can be converted to sleeping spinlocks. This has reduced a lot the PREEMPT_RT patch size!

Threaded interrupts

  • The mechanism of threaded interrupts in PREEMPT_RT is still different from the one merged in mainline
  • In PREEMPT_RT, all interrupt handlers are unconditionally converted to threaded interrupts.
  • This is a temporary solution, until interesting drivers in mainline get gradually converted to the new threaded interrupt API that has been merged in 2.6.30.

results matching ""

    No results matching ""