Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kernel thread --- "kthreadd"

Tags:

linux

kernel

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.

like image 667
Dongguo Avatar asked Nov 03 '22 11:11

Dongguo


1 Answers

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.

like image 91
human.js Avatar answered Nov 09 '22 12:11

human.js