Preemption and Xen
Jacob Mathai http://jacobmathai.blogspot.com/
Kernel Preemption and Xen
Preemption is the ability to interupt a kernel mode process. Kernel Preemption strives towards a CPU that is performing "higest priority processing" at any given time slice and is both art and technique. Most Linux User Mode processes are preemptive in the 'TASK_RUNNING' state. Older Linux 2.4 kernels generally are non-preemptive. Linux 2.6 kernels offer full preemptive capabilities with some exceptions. Preemption is important to "real time" applications running in Virtual Machines (DomU) as well in the scheduling of multiple VMs (Dom0). Under specific criteria, certain user programs running in kernel mode cannot be interrupted. This is further complicated by multi processing (SMP) and the challenges are similar with preemption and process scheduling. Preemptive kernels are important to operating systems and the Xen Kernel in particular because blocked tasks, flagged with higher priority, can preempt even lowerer priority kernel tasks. In theory, this can impact general performance, scheduler latency, user experience, and real time computing.
Xen Linux Kernel Preempt Options
- Preemptive Features in Linux 2.6 Kernels can be enabled in the kernel config.
- XEN/xen-unstable/linux-2.6.12-xen0/.config
CONFIG_PREEMPT=y
CONFIG_PREEMPT - This option reduces the latency of the kernel when reacting to real-time or interactive events by allowing a low priority process to be preempted even if it is in kernel mode executing a system call. Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure.
CONFIG_PREEMPT_BKL=y
CONFIG_PREEMPT_BKL - This option reduces the latency of the kernel by making the big kernel lock preemptible. Say Y here if you are building a kernel for a desktop system. Say N if you are unsure.
Links
Preemptive Kernel Patch 2.4 Kernel ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/
