[Hotplug_sig] [vatsa@xxxxxxxxxx: [PATCH] Check for online cpus before bringing them up]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Forwarded message from Srivatsa Vaddagiri <vatsa@xxxxxxxxxx> -----

Date: Thu, 16 Mar 2006 23:14:47 +0530
From: Srivatsa Vaddagiri <vatsa@xxxxxxxxxx>
To: Andrew Morton <akpm@xxxxxxxx>, torvalds@xxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx, shaohua.li@xxxxxxxxx, bryce@xxxxxxxx
Reply-To: vatsa@xxxxxxxxxx
Subject: [PATCH] Check for online cpus before bringing them up

Bryce reported a bug wherein offlining CPU0 (on x86 box) and then subsequently
onlining it resulted in a lockup. 

On x86, CPU0 is never offlined. The subsequent attempt to online CPU0
doesn't take that into account. It actually tries to bootup the already
booted CPU. Following patch fixes the problem (as acknowledged by
Bryce). Please consider for inclusion in 2.6.16.




Check if cpu is already online.

Signed-off-by : Srivatsa Vaddagiri <vatsa@xxxxxxxxxx>

-

 arch/i386/kernel/smpboot.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff -puN arch/i386/kernel/smpboot.c~cpuhp arch/i386/kernel/smpboot.c
--- linux-2.6.16-rc5/arch/i386/kernel/smpboot.c~cpuhp	2006-03-14 14:42:26.000000000 +0530
+++ linux-2.6.16-rc5-root/arch/i386/kernel/smpboot.c	2006-03-14 14:43:21.000000000 +0530
@@ -1029,6 +1029,12 @@ int __devinit smp_prepare_cpu(int cpu)
 	int	apicid, ret;
 
 	lock_cpu_hotplug();
+
+	if (cpu_online(cpu)) {
+		ret = -EINVAL;
+		goto exit;
+	}
+
 	apicid = x86_cpu_to_apicid[cpu];
 	if (apicid == BAD_APICID) {
 		ret = -ENODEV;

_


-- 
Regards,
vatsa

----- End forwarded message -----

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux