Dongguo
Dongguo

Reputation: 379

kernel thread --- "kthreadd"

As we all know, kthreadd is a kernel thread, which is used to help others create new kernel threads (Review kthread_create_list to see if there is any new kernel thread need to create).

But I can not understand why we do not use create_kthread to create a new kernel thread? I do not see any difference kthreadd makes.

Could you give me some suggestions, please.

Thanks for your great help.

Upvotes: 5

Views: 13934

Answers (1)

human.js
human.js

Reputation: 1382

Not Really. kthreadd is a daemon thread that runs in kernel space. The reason is that kernel needs to some times create threads but creating thread in kernel is very tricky. Hence kthreadd is a thread that kernel uses to spawn newer threads if required from there . This thread can access userspace address space also but should not do so . Its managed by kernel so one need not worry.

Upvotes: 2

Related Questions