public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <nathanl@austin.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Anton Blanchard <anton@samba.org>
Subject: [PATCH] ppc64 gives up too quickly on hotplugged cpu
Date: Wed, 02 Jun 2004 17:57:50 -0500	[thread overview]
Message-ID: <40BE5B6E.7060109@austin.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Hi-

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.

Patch is against 2.6.7-rc2; please apply.

Signed-off-by: Nathan Lynch <nathanl@austin.ibm.com>

[-- Attachment #2: ppc64_cpu_up_be_more_patient.patch --]
[-- Type: text/x-patch, Size: 910 bytes --]

diff -Naurp -X ../dontdiff 2.6.7-rc2/arch/ppc64/kernel/smp.c 2.6.7-rc2.new/arch/ppc64/kernel/smp.c
--- 2.6.7-rc2/arch/ppc64/kernel/smp.c	2004-06-02 17:08:48.000000000 -0500
+++ 2.6.7-rc2.new/arch/ppc64/kernel/smp.c	2004-06-02 17:12:16.000000000 -0500
@@ -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);

             reply	other threads:[~2004-06-02 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 22:57 Nathan Lynch [this message]
2004-06-10 12:03 ` [PATCH] ppc64 gives up too quickly on hotplugged cpu Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40BE5B6E.7060109@austin.ibm.com \
    --to=nathanl@austin.ibm.com \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox