All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 0/2] arch/CPU hotplug: Add missing CPU Hotplug bits to fix nasty issues
@ 2012-05-15 19:01 Srivatsa S. Bhat
  2012-05-15 19:02 ` [RESEND PATCH 1/2] parisc/CPU hotplug: Add missing call to notify_cpu_starting() Srivatsa S. Bhat
  2012-05-15 19:02 ` [RESEND PATCH 2/2] mn10300/CPU " Srivatsa S. Bhat
  0 siblings, 2 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2012-05-15 19:01 UTC (permalink / raw)
  To: torvalds
  Cc: akpm, mingo, a.p.zijlstra, mpatocka, stepanm, tglx,
	James.Bottomley, deller, dhowells, yasutake.koichi, eike-kernel,
	linux-parisc, linux-kernel, srivatsa.bhat, linux-am33-list

Unfortunately, some of the CPU Hotplug code has been duplicated in all of
the architectures. And in some cases, very poorly (some architectures left
out some of the important bits), to add to the woes.

Commit 5fbd036b552f633abb394a319f7c62a5c86a9cd7 (sched: Cleanup cpu_active
madness) introduced some changes that made the scheduler rely on the
CPU_STARTING notifier. And hence those architectures which forgot to
send out the CPU_STARTING notification will almost surely get into trouble.
(Xen is one example[1]).

The proper fix would be to pull out these bits into generic CPU Hotplug code.
But for now, fix this regression by adding the missing bits in the respective
architectures.

[1].https://lkml.org/lkml/2012/3/20/459
--
 Srivatsa S. Bhat (2):
      parisc/CPU hotplug: Add missing call to notify_cpu_starting()
      mn10300/CPU hotplug: Add missing call to notify_cpu_starting()


  arch/mn10300/kernel/smp.c |    9 ++++++---
 arch/parisc/kernel/smp.c  |    8 +++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)



Thanks,
Srivatsa S. Bhat
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RESEND PATCH 1/2] parisc/CPU hotplug: Add missing call to notify_cpu_starting()
  2012-05-15 19:01 [RESEND PATCH 0/2] arch/CPU hotplug: Add missing CPU Hotplug bits to fix nasty issues Srivatsa S. Bhat
@ 2012-05-15 19:02 ` Srivatsa S. Bhat
  2012-05-15 19:02 ` [RESEND PATCH 2/2] mn10300/CPU " Srivatsa S. Bhat
  1 sibling, 0 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2012-05-15 19:02 UTC (permalink / raw)
  To: torvalds
  Cc: akpm, mingo, a.p.zijlstra, mpatocka, stepanm, tglx,
	James.Bottomley, deller, dhowells, yasutake.koichi, eike-kernel,
	linux-parisc, linux-kernel, srivatsa.bhat, linux-am33-list

The scheduler depends on receiving the CPU_STARTING notification, without
which we end up into a lot of trouble. So add the missing call to
notify_cpu_starting() in the bringup code.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-and-Tested-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-and-Tested-by: Tobias Ulmer <tobiasu@tmux.org>
Tested-by: John David Anglin <dave.anglin@bell.net>
---

 arch/parisc/kernel/smp.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 0bb1d63..4dc7b79 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -31,6 +31,7 @@
 #include <linux/delay.h>
 #include <linux/bitops.h>
 #include <linux/ftrace.h>
+#include <linux/cpu.h>
 
 #include <linux/atomic.h>
 #include <asm/current.h>
@@ -295,8 +296,13 @@ smp_cpu_init(int cpunum)
 
 		printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
 		machine_halt();
-	}  
+	}
+
+	notify_cpu_starting(cpunum);
+
+	ipi_call_lock();
 	set_cpu_online(cpunum, true);
+	ipi_call_unlock();
 
 	/* Initialise the idle task for this CPU */
 	atomic_inc(&init_mm.mm_count);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [RESEND PATCH 2/2] mn10300/CPU hotplug: Add missing call to notify_cpu_starting()
  2012-05-15 19:01 [RESEND PATCH 0/2] arch/CPU hotplug: Add missing CPU Hotplug bits to fix nasty issues Srivatsa S. Bhat
  2012-05-15 19:02 ` [RESEND PATCH 1/2] parisc/CPU hotplug: Add missing call to notify_cpu_starting() Srivatsa S. Bhat
@ 2012-05-15 19:02 ` Srivatsa S. Bhat
  1 sibling, 0 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2012-05-15 19:02 UTC (permalink / raw)
  To: torvalds
  Cc: akpm, mingo, a.p.zijlstra, mpatocka, stepanm, tglx,
	James.Bottomley, deller, dhowells, yasutake.koichi, eike-kernel,
	linux-parisc, linux-kernel, srivatsa.bhat, linux-am33-list

The scheduler depends on receiving the CPU_STARTING notification, without
which we end up into a lot of trouble. So add the missing call to
notify_cpu_starting() in the bringup code.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

 arch/mn10300/kernel/smp.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index 910dddf..9cd69ad 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -24,6 +24,7 @@
 #include <linux/sched.h>
 #include <linux/profile.h>
 #include <linux/smp.h>
+#include <linux/cpu.h>
 #include <asm/tlbflush.h>
 #include <asm/bitops.h>
 #include <asm/processor.h>
@@ -38,7 +39,6 @@
 #include "internal.h"
 
 #ifdef CONFIG_HOTPLUG_CPU
-#include <linux/cpu.h>
 #include <asm/cacheflush.h>
 
 static unsigned long sleep_mode[NR_CPUS];
@@ -874,10 +874,13 @@ static void __init smp_online(void)
 
 	cpu = smp_processor_id();
 
-	local_irq_enable();
+	notify_cpu_starting(cpu);
 
+	ipi_call_lock();
 	set_cpu_online(cpu, true);
-	smp_wmb();
+	ipi_call_unlock();
+
+	local_irq_enable();
 }
 
 /**


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-15 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 19:01 [RESEND PATCH 0/2] arch/CPU hotplug: Add missing CPU Hotplug bits to fix nasty issues Srivatsa S. Bhat
2012-05-15 19:02 ` [RESEND PATCH 1/2] parisc/CPU hotplug: Add missing call to notify_cpu_starting() Srivatsa S. Bhat
2012-05-15 19:02 ` [RESEND PATCH 2/2] mn10300/CPU " Srivatsa S. Bhat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.