Re: looking for info on kernel_thread

Stephen C. Tweedie (sct@redhat.com)
Tue, 13 Apr 1999 17:54:04 +0100 (BST)


Hi,

On Mon, 12 Apr 1999 12:20:29 -0400 (EDT), "Jason A. Pfeil"
<pfeil@nu.cs.fsu.edu> said:

> kernel_thread is used to create the kernel-level processes like kswapd,
> bdflush, and others. I would tend to think that it is preemptable like
> any other process, but I could be wrong. Feel free to correct me. :)

OK. :)

The are _non_ preemptable, just like any other process. The general
rule is that we never, ever preempt a process which is running in kernel
mode. That means that normal user processes do not get preempted in the
middle of a system call, for example. It also means that kernel
threads, which run entirely within kernel mode, are automatically
protected against preemption by the scheduler.

Kernel threads are still allowed to be rescheduled, but only
voluntarily: if they sleep on a wait queue, wait for IO, take a page
fault which has to satisfy disk or call the scheduler directly, they
will be rescheduled.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/