mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>, "Jeff Chua" <jeff.chua.linux@gmail.com>
Cc: "David Miller" <davem@davemloft.net>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.27rc1 cannot boot more than 8CPUs
Date: Wed, 13 Aug 2008 11:33:12 -0700	[thread overview]
Message-ID: <86802c440808131133o133e1dfftdfcc076a1100afb6@mail.gmail.com> (raw)
In-Reply-To: <86802c440808131046s4df84ba9va12d45897cf6affa@mail.gmail.com>

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

On Wed, Aug 13, 2008 at 10:46 AM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> On Wed, Aug 13, 2008 at 10:39 AM, Ingo Molnar <mingo@elte.hu> wrote:
>>
>> * Jeff Chua <jeff.chua.linux@gmail.com> wrote:
>>
>>> On Thu, Aug 14, 2008 at 1:10 AM, Jeff Chua <jeff.chua.linux@gmail.com> wrote:
>>> > On Wed, Aug 13, 2008 at 10:16 PM, Ingo Molnar <mingo@elte.hu> wrote:
>>> >
>>> >> btw., could you please check that v2.6.27-rc3 (or later) kernels boot
>>> >> fine (with about 8 cpus) even if you have genericarch/bigsmp disabled,
>>> >> and do not silently hang as it happened on your box before?
>>> >
>>> > With 16 CPUs, it still hangs, but now the console is showing the
>>> > errors as intended.
>>> > ... but it is supposed to hang?
>>>
>>> I tried with just CONFIG_NR_CPUS=8 and this time it booted, but stange
>>> thing is I only see 2 CPUs! To be more precise, it's without both
>>> CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.
>>>
>>> And when I tried to enable the CPUs, it complained about:
>>>
>>> # cat cpu6/online
>>> 0
>>> # echo 1 > cpu6/online
>>> More than 8 CPUs detected - skipping them.
>>> Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.
>>> -bash: echo: write error: Input/output error
>>>
>>> Prior to the patch, the system booted with all 8 CPUs.
>
> that is new regression...

jeff,

please check the attached patch. it should fix the new regression and
will not hang.

YH

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: big_smp_check.patch --]
[-- Type: text/x-patch; name=big_smp_check.patch, Size: 1839 bytes --]

[PATCH] x86: check bigsmp in smp_sanity_check instead of cpu_up

clear bits for cpu nr > 8

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 arch/x86/kernel/smpboot.c |   38 ++++++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 10 deletions(-)

Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/smpboot.c
+++ linux-2.6/arch/x86/kernel/smpboot.c
@@ -987,17 +987,7 @@ int __cpuinit native_cpu_up(unsigned int
 	flush_tlb_all();
 	low_mappings = 1;
 
-#ifdef CONFIG_X86_PC
-	if (def_to_bigsmp && apicid > 8) {
-		printk(KERN_WARNING
-			"More than 8 CPUs detected - skipping them.\n"
-			"Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
-		err = -1;
-	} else
-		err = do_boot_cpu(apicid, cpu);
-#else
 	err = do_boot_cpu(apicid, cpu);
-#endif
 
 	zap_low_mappings();
 	low_mappings = 0;
@@ -1051,6 +1041,34 @@ static __init void disable_smp(void)
 static int __init smp_sanity_check(unsigned max_cpus)
 {
 	preempt_disable();
+
+#if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
+        if (def_to_bigsmp && nr_cpu_ids > 8) {
+		unsigned int cpu;
+		unsigned nr;
+
+                printk(KERN_WARNING
+                        "More than 8 CPUs detected - skipping them.\n"
+                        "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+
+		nr = 0;
+		for_each_present_cpu(cpu) {
+			if (nr >= 8)
+				cpu_clear(cpu, cpu_present_map);
+			nr++;
+		}
+
+		nr = 0;
+		for_each_possible_cpu(cpu) {
+			if (nr >= 8)
+				cpu_clear(cpu, cpu_possible_map);
+			nr++;
+		}
+
+		nr_cpu_ids = 8;
+        }
+#endif
+
 	if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
 		printk(KERN_WARNING "weird, boot CPU (#%d) not listed"
 				    "by the BIOS.\n", hard_smp_processor_id());

  reply	other threads:[~2008-08-13 18:33 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 11:09 Jeff Chua
2008-08-06 16:13 ` Yinghai Lu
2008-08-06 16:34   ` Jeff Chua
2008-08-11 19:54 ` Ingo Molnar
2008-08-13 14:16 ` Ingo Molnar
2008-08-13 17:10   ` Jeff Chua
2008-08-13 17:33     ` Jeff Chua
2008-08-13 17:39       ` Ingo Molnar
2008-08-13 17:46         ` Yinghai Lu
2008-08-13 18:33           ` Yinghai Lu [this message]
2008-08-14  7:16             ` Jeff Chua
2008-08-14  8:59               ` Yinghai Lu
2008-08-14  9:07               ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-08-15 10:34 Jeff Chua
2008-08-15 14:07 ` Ingo Molnar
2008-08-18  3:07   ` Jeff Chua
2008-08-18  8:00     ` Ingo Molnar
2008-08-06  3:15 Jeff Chua
2008-08-06  3:31 ` Max Krasnyansky
2008-08-06  3:50   ` Jeff Chua
2008-08-06  3:54     ` Max Krasnyansky
2008-08-06  4:06       ` Jeff Chua
2008-08-06  4:48         ` Max Krasnyansky
2008-08-06  4:53           ` Li Zefan
2008-08-06 20:11             ` Max Krasnyansky
     [not found] ` <86802c440808052050u489264beo30812523669ef4df@mail.gmail.com>
2008-08-06  4:05   ` Jeff Chua
2008-08-06  5:19 ` David Miller
2008-08-06  6:42   ` Jeff Chua
2008-08-06  7:18     ` David Miller
2008-08-06  9:33       ` Jeff Chua
2008-08-06  9:36         ` David Miller
2008-08-06  9:50           ` Jeff Chua
2008-08-06  8:49     ` Yinghai Lu
2008-08-06  9:35       ` Jeff Chua
2008-08-06  9:42         ` Jeff Chua
2008-08-06  6:01 ` Linus Torvalds
2008-08-06  6:42   ` Jeff Chua
2008-08-06 15:33     ` Jeff Chua
2008-08-11 19:59       ` Ingo Molnar
2008-08-11 20:03         ` Yinghai Lu
2008-08-11 20:08           ` Ingo Molnar
2008-08-11 20:12             ` Yinghai Lu
2008-08-11 20:36               ` Yinghai Lu
2008-08-11 20:44                 ` Ingo Molnar

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=86802c440808131133o133e1dfftdfcc076a1100afb6@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jeff.chua.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®