0

How kernel threads gets executed on the CPU does these kernel threads get scheduled by the scheduller , like normal user space processes? or they get waken up when some events happen ?

root         2     0  0 Nov30 ?        00:00:00 [kthreadd]
root         3     2  0 Nov30 ?        00:00:03 [ksoftirqd/0]
user3718463
  • 265
  • 1
  • 7
  • this should answer most of your questions: http://stackoverflow.com/questions/8463741/how-linux-handles-threads-and-process-scheduling – askb Dec 03 '14 at 05:12

2 Answers2

2

The answer to both questions is yes - kernel threads gets scheduled just like user threads and they are normally blocking pending certain events (different events per kernel thread).

gby
  • 14,900
  • 40
  • 57
0

Answer is Yes.

Only major difference between kernel threads and user space process would be task->mm = NULL for kernel threads.

Hence they don't have distinct address space. Rest is pretty much same for kernel threads and user space processes.

tekkk
  • 324
  • 2
  • 8