Preemption Models

The various preemption models are kernel specific. In principle, user space programs are always preemptible.

Preemption of a running task is performed by the scheduler. This action can be triggered by a kernel interaction like a system call or an asynchronous event like an interrupt. The scheduler saves the context of the preempted task and restores the context of the new task.

The Linux kernel implements several preemption models. The desired model is selected at build time of the kernel. The “Fully Preemptible Kernel” preemption model must be selected to obtain Linux as an RTOS. For the sake of completeness a list and a short explanation of the existing Linux preemption models is given. The last two entries are available only with the PREEMPT_RT patch.

References: