Linux Kernel Threads - Scheduler

Is the Linux kernel scheduler part of the init process? I understand that this is part of the Kernel threads that are not internally visible to the user, either from above or ps. Please correct my understanding.

Can I view standard kernel threads through any kernel debugger to see how standard threads take up processor activity?

-Kartlee

+4
source share
2 answers

The kernel threads can be seen through the "top" and "ps" and can be distinguished by having a virtual machine size of zero (they do not have user space, so there is no user space memory card).

They are created by kernel_thread (or by his friends). Some tools create one thread per processor and bind it to the processor, so you see things like aio / 0 aio / 1 in the PS list.

Also, some work is performed using several deferred execution mechanisms and assigned to other tasks, usually called events / 0 (one per processor). The time "actually" spent in interrupts is not taken into account anywhere (it is simply carried out at the expense of any task located on this CPU at that time).

+6
source

1) Is the Linux kernel scheduler part of the init process?

-> no, the scheduler is a subsystem, the initialization process is just a process, but it is special and planned by the scheduler.

2) I understand that this is part of the Kernel threads that are not internally visible to the user, either from above or ps. Please correct my understanding.

-> This is a kind of kernel thread and is usually not displayed to the user.

3) Is it possible to view standard kernel threads through any kernel debugger to see how standard threads take up processor activity?

-> yes!

+1
source

Source: https://habr.com/ru/post/1303896/


All Articles