user3718463
user3718463

Reputation: 265

Does kernel threads get scheduled by the scheduller?

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]

Upvotes: 0

Views: 177

Answers (2)

tekkk
tekkk

Reputation: 334

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.

Upvotes: 0

gby
gby

Reputation: 15218

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).

Upvotes: 2

Related Questions