public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: move prefill_possible_map calling early
Date: Wed, 2 Jul 2008 18:54:40 -0700	[thread overview]
Message-ID: <200807021854.40729.yhlu.kernel@gmail.com> (raw)
In-Reply-To: <200807021851.02301.yinghai.lu@sun.com>


call it right after we done with MADT/mptable handling, instead of doing that
in setup_per_cpu_areas later...
so for_possible_cpu could be used early.

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

---
 arch/x86/kernel/setup.c        |    1 +
 arch/x86/kernel/setup_percpu.c |   10 ----------
 arch/x86/kernel/smpboot.c      |    8 ++++++++
 include/asm-x86/smp.h          |    4 ++++
 4 files changed, 13 insertions(+), 10 deletions(-)

Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -788,6 +788,7 @@ void __init setup_arch(char **cmdline_p)
 		get_smp_config();
 #endif
 
+	prefill_possible_map();
 #ifdef CONFIG_X86_64
 	init_cpu_to_node();
 #endif
Index: linux-2.6/arch/x86/kernel/setup_percpu.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_percpu.c
+++ linux-2.6/arch/x86/kernel/setup_percpu.c
@@ -162,16 +162,6 @@ void __init setup_per_cpu_areas(void)
 	char *ptr;
 	int cpu;
 
-	/* no processor from mptable or madt */
-	if (!num_processors)
-		num_processors = 1;
-
-#ifdef CONFIG_HOTPLUG_CPU
-	prefill_possible_map();
-#else
-	nr_cpu_ids = num_processors;
-#endif
-
 	/* Setup cpu_pda map */
 	setup_cpu_pda_map();
 
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
@@ -1278,12 +1278,20 @@ __init void prefill_possible_map(void)
 	int i;
 	int possible;
 
+	/* no processor from mptable or madt */
+	if (!num_processors)
+		num_processors = 1;
+
+#ifdef CONFIG_HOTPLUG_CPU
 	if (additional_cpus == -1) {
 		if (disabled_cpus > 0)
 			additional_cpus = disabled_cpus;
 		else
 			additional_cpus = 0;
 	}
+#else
+	additional_cpus = 0;
+#endif
 	possible = num_processors + additional_cpus;
 	if (possible > NR_CPUS)
 		possible = NR_CPUS;
Index: linux-2.6/include/asm-x86/smp.h
===================================================================
--- linux-2.6.orig/include/asm-x86/smp.h
+++ linux-2.6/include/asm-x86/smp.h
@@ -124,6 +124,10 @@ static inline int num_booting_cpus(void)
 {
 	return cpus_weight(cpu_callout_map);
 }
+#else
+static inline void prefill_possible_map(void)
+{
+}
 #endif /* CONFIG_SMP */
 
 extern unsigned disabled_cpus __cpuinitdata;

  parent reply	other threads:[~2008-07-03  7:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  1:34 [PATCH] x86: don't reallocate pgt for node0 Yinghai Lu
2008-07-01  8:44 ` Ingo Molnar
2008-07-02  3:02 ` [PATCH] x86: change copy_e820_map to append_e820_map Yinghai Lu
2008-07-03 13:58   ` Ingo Molnar
2008-07-02  3:03 ` [PATCH] x86: make early_res_to_bootmem print out less 80 width chars Yinghai Lu
2008-07-03 13:58   ` Ingo Molnar
2008-07-02  3:04 ` [PATCH] x86: not printout if not finding setup_data Yinghai Lu
2008-07-03 13:55   ` Ingo Molnar
2008-07-02  7:31 ` [PATCH] x86: merge zones_sizes_init for numa and non numa on 32bit Yinghai Lu
2008-07-03 13:54   ` Ingo Molnar
2008-07-03  1:53 ` [PATCH] x86: move init_cpu_to_node after get_smp_config Yinghai Lu
2008-07-03 13:54   ` Ingo Molnar
     [not found] ` <200807021851.02301.yinghai.lu@sun.com>
2008-07-03  1:54   ` Yinghai Lu [this message]
2008-07-03 13:54     ` [PATCH] x86: move prefill_possible_map calling early Ingo Molnar
2008-07-03 14:03       ` 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=200807021854.40729.yhlu.kernel@gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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