KTHREAD_CREATE

포스트: 1|아이템:KTHREA(1)
Tags

Posts

1 post

[리눅스커널] 프로세스 - 커널 프로세스 생성 시 do_fork() 함수 흐름

Guillermo Austin Kim|2018년 10월 22일

커널 공간에서 시스템 리소스(메모리, 전원) 관리를 수행하는 프로세스를 커널 스레드라고 합니다. 커널 스레드는 어떻게 생성할까요? 다음과 같이 kthread_create() 함수에 적절한 인자를 전달하면 됩니다. 커널 스레드를 생성하는 코드를 같이 봅시다. [https://elixir.bootlin.com/linux/v4.14.70/source/drivers/vhost/vhost.c#L334]1 long vhost_dev_set_owner(struct vhost_dev *dev)2 {3 struct task_struct *worker;4 int err;...5 /* No owner, become one */6 dev->mm = get_task_mm(current);7 worker = kthread_c