[PATCH 22/27] um, smpboot: Use generic SMP booting infrastructure

From
Srivatsa S. Bhat <hidden>
Date
2012-06-01 10:23:20
Also in
linux-um, lkml
Reply to
Srivatsa S. Bhat, 2012-06-01
From: Nikunj A. Dadhania <redacted>

Convert um to use the generic framework to boot secondary CPUs.

Notes:
1. Removed call to default_idle() in idle_proc(). The generic framework will
invoke cpu_idle().
2. The generic code will call preempt_disable() and local_irq_enable() which
weren't originally present in idle_proc().

Signed-off-by: Nikunj A. Dadhania <redacted>
Cc: Jeff Dike <redacted>
Cc: Richard Weinberger <richard@nod.at>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Rusty Russell <redacted>
Cc: Chris Metcalf <redacted>
Cc: Thomas Gleixner <redacted>
Cc: <redacted>
Cc: <redacted>
Signed-off-by: Srivatsa S. Bhat <redacted>
---

 arch/um/kernel/smp.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index a02b7e9..6cffcf4 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -10,6 +10,7 @@
 #ifdef CONFIG_SMP
 
 #include "linux/sched.h"
+#include "linux/smpboot.h"
 #include "linux/module.h"
 #include "linux/threads.h"
 #include "linux/interrupt.h"
@@ -58,6 +59,12 @@ static cpumask_t cpu_callin_map = CPU_MASK_NONE;
 
 static int idle_proc(void *cpup)
 {
+	smpboot_start_secondary(cpup);
+	return 0;
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
 	int cpu = (int) cpup, err;
 
 	err = os_pipe(cpu_data[cpu].ipi_pipe, 1, 1);
@@ -74,11 +81,6 @@ static int idle_proc(void *cpup)
 
 	while (!cpu_isset(cpu, smp_commenced_mask))
 		cpu_relax();
-
-	notify_cpu_starting(cpu);
-	set_cpu_online(cpu, true);
-	default_idle();
-	return 0;
 }
 
 static struct task_struct *idle_thread(int cpu)
Thread (81 messages) 81 messages, 12 authors, last reply 2012-06-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help