Commit d7a7c573 authored by Suresh Siddha's avatar Suresh Siddha Committed by Linus Torvalds

x86, ia64, smp: use workqueues unconditionally during do_boot_cpu()

Workqueues are now initialized as part of the early_initcall().  So they
are available for use during cold boot process aswell.
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e4461271
...@@ -508,21 +508,18 @@ do_boot_cpu (int sapicid, int cpu) ...@@ -508,21 +508,18 @@ do_boot_cpu (int sapicid, int cpu)
.done = COMPLETION_INITIALIZER(c_idle.done), .done = COMPLETION_INITIALIZER(c_idle.done),
}; };
/*
* We can't use kernel_thread since we must avoid to
* reschedule the child.
*/
c_idle.idle = get_idle_for_cpu(cpu); c_idle.idle = get_idle_for_cpu(cpu);
if (c_idle.idle) { if (c_idle.idle) {
init_idle(c_idle.idle, cpu); init_idle(c_idle.idle, cpu);
goto do_rest; goto do_rest;
} }
/*
* We can't use kernel_thread since we must avoid to reschedule the child.
*/
if (!keventd_up())
c_idle.work.func(&c_idle.work);
else {
schedule_work(&c_idle.work); schedule_work(&c_idle.work);
wait_for_completion(&c_idle.done); wait_for_completion(&c_idle.done);
}
if (IS_ERR(c_idle.idle)) if (IS_ERR(c_idle.idle))
panic("failed fork for CPU %d", cpu); panic("failed fork for CPU %d", cpu);
......
...@@ -735,12 +735,8 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) ...@@ -735,12 +735,8 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
goto do_rest; goto do_rest;
} }
if (!keventd_up())
c_idle.work.func(&c_idle.work);
else {
schedule_work(&c_idle.work); schedule_work(&c_idle.work);
wait_for_completion(&c_idle.done); wait_for_completion(&c_idle.done);
}
if (IS_ERR(c_idle.idle)) { if (IS_ERR(c_idle.idle)) {
printk("failed fork for CPU %d\n", cpu); printk("failed fork for CPU %d\n", cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment