aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-07-24 21:21:30 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-26 10:40:33 -0400
commit6524d938b3360504b43a1278b5a8403e85383d1a (patch)
tree8edbe9e88883e992f63c68ca0f1ea3ab4594ebb9
parentb8d317d10cca76cabe6b03ebfeb23cc99118b731 (diff)
cpumask: put cpumask_of_cpu_map in the initdata section
* Create the cpumask_of_cpu_map statically in the init data section using NR_CPUS but replace it during boot up with one sized by nr_cpu_ids (num possible cpus). Signed-off-by: Mike Travis <travis@sgi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jack Steiner <steiner@sgi.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/setup_percpu.c10
-rw-r--r--kernel/cpu.c8
2 files changed, 11 insertions, 7 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index f7745f94c006..1cd53dfcd309 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -81,10 +81,12 @@ static void __init setup_per_cpu_maps(void)
81} 81}
82 82
83#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP 83#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
84cpumask_t *cpumask_of_cpu_map __read_mostly; 84/*
85EXPORT_SYMBOL(cpumask_of_cpu_map); 85 * Replace static cpumask_of_cpu_map in the initdata section,
86 86 * with one that's allocated sized by the possible number of cpus.
87/* requires nr_cpu_ids to be initialized */ 87 *
88 * (requires nr_cpu_ids to be initialized)
89 */
88static void __init setup_cpumask_of_cpu(void) 90static void __init setup_cpumask_of_cpu(void)
89{ 91{
90 int i; 92 int i;
diff --git a/kernel/cpu.c b/kernel/cpu.c
index fe31ff3d3809..9d4e1c28c053 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -462,7 +462,6 @@ out:
462 462
463#endif /* CONFIG_SMP */ 463#endif /* CONFIG_SMP */
464 464
465#ifndef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
466/* 64 bits of zeros, for initializers. */ 465/* 64 bits of zeros, for initializers. */
467#if BITS_PER_LONG == 32 466#if BITS_PER_LONG == 32
468#define Z64 0, 0 467#define Z64 0, 0
@@ -509,7 +508,11 @@ out:
509 508
510/* We want this statically initialized, just to be safe. We try not 509/* We want this statically initialized, just to be safe. We try not
511 * to waste too much space, either. */ 510 * to waste too much space, either. */
512static const cpumask_t cpumask_map[] = { 511static const cpumask_t cpumask_map[]
512#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
513__initdata
514#endif
515= {
513 CMI0(0), CMI0(1), CMI0(2), CMI0(3), 516 CMI0(0), CMI0(1), CMI0(2), CMI0(3),
514#if NR_CPUS > 4 517#if NR_CPUS > 4
515 CMI0(4), CMI0(5), CMI0(6), CMI0(7), 518 CMI0(4), CMI0(5), CMI0(6), CMI0(7),
@@ -569,4 +572,3 @@ static const cpumask_t cpumask_map[] = {
569}; 572};
570 573
571const cpumask_t *cpumask_of_cpu_map = cpumask_map; 574const cpumask_t *cpumask_of_cpu_map = cpumask_map;
572#endif /* !CONFIG_HAVE_CPUMASK_OF_CPU_MAP */