Skip to content

Kernel preemption

Kernel preemption is a method used mainly in monolithic and hybrid kernels where all or most device drivers are run in kernel space, whereby the scheduler is permitted to forcibly perform a context switch (i.e. preemptively schedule; on behalf of a runnable and higher priority process) on a driver or other part of the kernel during its execution, rather than co-operatively waiting for the driver or kernel function (such as a system call) to complete its execution and return control of the processor to the scheduler.[1][2][3][4]

There are two main benefits to this method in monolithic and hybrid kernels, and answer one of the main criticisms of monolithic kernels from microkernel advocates, which is that:

  • A device driver can enter an infinite loop or other unrecoverable state, crashing the whole system.[1]
  • Some drivers and system calls on monolithic kernels are slow to execute, and cannot return control of the processor to the scheduler or other program until they complete execution.[2]

See also