Thread (104 messages) 104 messages, 13 authors, 2013-02-19
STALE4847d

[PATCH v5 38/45] parisc: Use get/put_online_cpus_atomic() to prevent CPU offline

From: Srivatsa S. Bhat <hidden>
Date: 2013-01-22 07:45:39
Also in: linux-arch, linux-pm, linuxppc-dev, lkml, netdev
Subsystem: parisc architecture, the rest · Maintainers: "James E.J. Bottomley", Helge Deller, Linus Torvalds

Once stop_machine() is gone from the CPU offline path, we won't be able to
depend on preempt_disable() or local_irq_disable() to prevent CPUs from
going offline from under us.

Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline,
while invoking from atomic context.

Cc: "James E.J. Bottomley" <redacted>
Cc: linux-parisc at vger.kernel.org
Signed-off-by: Srivatsa S. Bhat <redacted>
---

 arch/parisc/kernel/smp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 6266730..f7851b7 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -229,11 +229,13 @@ static inline void
 send_IPI_allbutself(enum ipi_message_type op)
 {
 	int i;
-	
+
+	get_online_cpus_atomic();
 	for_each_online_cpu(i) {
 		if (i != smp_processor_id())
 			send_IPI_single(i, op);
 	}
+	put_online_cpus_atomic();
 }
 
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help