$linuxjunkies
>

preemption

also: kernel preemption, task preemption, preemptive multitasking

The ability of the operating system to interrupt a running process and switch to another task, ensuring fair processor time distribution and responsiveness. In Linux, preemption allows the kernel itself to be interrupted, not just user processes.

Preemption is a scheduling mechanism where the kernel can forcibly pause a running process or kernel operation to execute a higher-priority task. Without preemption, a process would run until it voluntarily yields the CPU, potentially causing system latency and poor responsiveness.

Linux supports two main types: user preemption (interrupting user-space processes at system call boundaries) and kernel preemption (interrupting kernel code itself). Kernel preemption, introduced in Linux 2.6, significantly improved latency on systems where long-running kernel operations would otherwise block other tasks.

Example: When a high-priority real-time process becomes ready while a lower-priority process is running, the scheduler can immediately preempt the current task, pause it, and run the high-priority process instead. This is critical for responsive systems—without preemption, a user input might wait indefinitely if a background process hogged the CPU.

Related terms