Re: [PATCH 0/1] kthreads: simplify !kthreadd_task logic, killkthreadd_task_init_done

From: Linus Torvalds
Date: Fri Sep 18 2009 - 15:19:56 EST




On Fri, 18 Sep 2009, Oleg Nesterov wrote:
> > rcu_scheduler_starting();
> > - kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
> > - numa_default_policy();
> > pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
> > kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
> > + kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
>
> We can't do this. kernel_init() should run with ->pid == 1, we are
> going to exec /sbin/init.

Umm - why not just add CLONE_PID to the 'kthreadd' creation, then?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/