kernel thread — “kthreadd”

2019-05-01 13:58发布

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.

标签: linux kernel
1条回答
Viruses.
2楼-- · 2019-05-01 14:37

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.

查看更多
登录 后发表回答