|
@@ -414,6 +414,16 @@ static noinline void __ref rest_init(void)
|
|
|
rcu_read_lock();
|
|
|
kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
|
|
|
rcu_read_unlock();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Enable might_sleep() and smp_processor_id() checks.
|
|
|
+ * They cannot be enabled earlier because with CONFIG_PRREMPT=y
|
|
|
+ * kernel_thread() would trigger might_sleep() splats. With
|
|
|
+ * CONFIG_PREEMPT_VOLUNTARY=y the init task might have scheduled
|
|
|
+ * already, but it's stuck on the kthreadd_done completion.
|
|
|
+ */
|
|
|
+ system_state = SYSTEM_SCHEDULING;
|
|
|
+
|
|
|
complete(&kthreadd_done);
|
|
|
|
|
|
/*
|