]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64 gives up too quickly on hotplugged cpu
authorAndrew Morton <akpm@osdl.org>
Thu, 3 Jun 2004 00:58:47 +0000 (17:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 00:58:47 +0000 (17:58 -0700)
From: Nathan Lynch <nathanl@austin.ibm.com>

On some systems it can take a hotplugged cpu much longer to come up than it
would at boot.  If the cpu comes up after we've given up on it, it tends to
die in its first attempt to kmem_cache_alloc (uninitialized percpu data, I
imagine).

In my experimentation I haven't seen a processor take more than one second
to become available; the patch waits five seconds just to be safe.

Signed-off-by: Nathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/smp.c

index 051e31c07559cc9a932b2e446f06128cab2d8347..5254a57e4e0d710b72ac8ba4ab790920703bb8a6 100644 (file)
@@ -912,8 +912,20 @@ int __devinit __cpu_up(unsigned int cpu)
         * use this value that I found through experimentation.
         * -- Cort
         */
-       for (c = 5000; c && !cpu_callin_map[cpu]; c--)
-               udelay(100);
+       if (system_state == SYSTEM_BOOTING)
+               for (c = 5000; c && !cpu_callin_map[cpu]; c--)
+                       udelay(100);
+#ifdef CONFIG_HOTPLUG_CPU
+       else
+               /*
+                * CPUs can take much longer to come up in the
+                * hotplug case.  Wait five seconds.
+                */
+               for (c = 25; c && !cpu_callin_map[cpu]; c--) {
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(HZ/5);
+               }
+#endif
 
        if (!cpu_callin_map[cpu]) {
                printk("Processor %u is stuck.\n", cpu);