Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The Linux kernel can run in interrupt context or in process (user) context. Process context means it is running on behalf of a process, which has called a syscall. Interrupt context means it is running on behalf of some kind of interrupt (hardware interrupt, softirq, ...). </p> <p>When you talk about preemptive multitasking, it means the kernel can decide to preempt some task to run another task. When you talk about preemptive kernels, it means the kernel can decide to preempt itself running to run some other kernel code.</p> <p>Now, before Linux was a preemptive kernel, you could run kernel code on several CPUs, and kernel code could be interrupted by hardware interrupts (which could end up running softirqs before returning,...). Preemptive kernels mean the kernel can also be preemptied by process context kernel code, to avoid long latencies (preemptive Linux came from the Linux realtime tree).</p> <p>Of course, all of this is better explained in Rusty Russell's <a href="http://www.kernel.org/doc/htmldocs/kernel-hacking.html" rel="nofollow noreferrer">Unreliable Guide to Kernel Hacking</a> and <a href="http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/" rel="nofollow noreferrer">Unreliable Guide to Kernel Locking</a>.</p> <p>EDIT:</p> <p>Or, trying to explain it better, when a task calls a syscall on a non-preemptive kernel, that task cannot be preemptied until the syscall ends (maybe with EINTR, but this could be a long time). A preemptive kernel allows that task to be preemptied, leading to lower average-case and worst-case latencies for other tasks waiting to run.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload