提交 6524d938 编写于 作者: M Mike Travis 提交者: Ingo Molnar

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: NMike 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: NIngo Molnar <mingo@elte.hu>
上级 b8d317d1
...@@ -81,10 +81,12 @@ static void __init setup_per_cpu_maps(void) ...@@ -81,10 +81,12 @@ static void __init setup_per_cpu_maps(void)
} }
#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
cpumask_t *cpumask_of_cpu_map __read_mostly; /*
EXPORT_SYMBOL(cpumask_of_cpu_map); * Replace static cpumask_of_cpu_map in the initdata section,
* with one that's allocated sized by the possible number of cpus.
/* requires nr_cpu_ids to be initialized */ *
* (requires nr_cpu_ids to be initialized)
*/
static void __init setup_cpumask_of_cpu(void) static void __init setup_cpumask_of_cpu(void)
{ {
int i; int i;
......
...@@ -462,7 +462,6 @@ void __ref enable_nonboot_cpus(void) ...@@ -462,7 +462,6 @@ void __ref enable_nonboot_cpus(void)
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#ifndef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
/* 64 bits of zeros, for initializers. */ /* 64 bits of zeros, for initializers. */
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
#define Z64 0, 0 #define Z64 0, 0
...@@ -509,7 +508,11 @@ void __ref enable_nonboot_cpus(void) ...@@ -509,7 +508,11 @@ void __ref enable_nonboot_cpus(void)
/* We want this statically initialized, just to be safe. We try not /* We want this statically initialized, just to be safe. We try not
* to waste too much space, either. */ * to waste too much space, either. */
static const cpumask_t cpumask_map[] = { static const cpumask_t cpumask_map[]
#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
__initdata
#endif
= {
CMI0(0), CMI0(1), CMI0(2), CMI0(3), CMI0(0), CMI0(1), CMI0(2), CMI0(3),
#if NR_CPUS > 4 #if NR_CPUS > 4
CMI0(4), CMI0(5), CMI0(6), CMI0(7), CMI0(4), CMI0(5), CMI0(6), CMI0(7),
...@@ -569,4 +572,3 @@ static const cpumask_t cpumask_map[] = { ...@@ -569,4 +572,3 @@ static const cpumask_t cpumask_map[] = {
}; };
const cpumask_t *cpumask_of_cpu_map = cpumask_map; const cpumask_t *cpumask_of_cpu_map = cpumask_map;
#endif /* !CONFIG_HAVE_CPUMASK_OF_CPU_MAP */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册