views:

298

answers:

1

Hi People,

Is Linux Kernel scheduler a part of init process? My understanding is that it is part of Kernel threads managed internally not visible to user by either top or ps. Please correct my understanding.

Is it possible to view standard kernel threads through any kernel debugger to see how standard threads occupy cpu activity?

-Kartlee

+1  A: 

Kernel threads can be seen through "top" and "ps" and can be distinguished by having zero VM size (they have no userspace, so no userspace memory map).

These are created by kernel_thread (or its friends). Some facilities create one thread per CPU and tie it to a CPU, so you see stuff like aio/0 aio/1 on the PS list.

Also some work is done through the several deferred execution mechanisms and gets attributed to other tasks, typically something called "events/0" (one per CPU). Time spent "really" in interrupts isn't counted anywhere (it just runs at the expense of whatever task happened to be on that CPU at the time).

MarkR
It's also worth pointing out that the vast majority of kernel code, including the scheduler, executes in the context of normal processes. In this way a large amount of the kernel acts a bit like a library, rather than a distinct process in its own right.
caf