diff options
author | Mike Travis <travis@sgi.com> | 2008-04-04 21:11:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:59 -0400 |
commit | 321a8e9dcb714f3c350ba55e41ed447bf3f05fac (patch) | |
tree | e75ca8ebcee0954dc6e313864ebba9f72e984fc8 /init | |
parent | 7c16ec585c558960a508ccf9a08fcb9ed49b3754 (diff) |
cpumask: add CPU_MASK_ALL_PTR macro
* Add a static cpumask_t variable "CPU_MASK_ALL_PTR" to use as
a pointer reference to CPU_MASK_ALL. This reduces where possible
the instances where CPU_MASK_ALL allocates and fills a large
array on the stack. Used only if NR_CPUS > BITS_PER_LONG.
* Change init/main.c to use new set_cpus_allowed_ptr().
Depends on:
[sched-devel]: sched: add new set_cpus_allowed_ptr function
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c index 99ce94930b09..2df3f0617fdc 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -363,6 +363,11 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { } | |||
363 | 363 | ||
364 | #else | 364 | #else |
365 | 365 | ||
366 | #if NR_CPUS > BITS_PER_LONG | ||
367 | cpumask_t cpu_mask_all __read_mostly = CPU_MASK_ALL; | ||
368 | EXPORT_SYMBOL(cpu_mask_all); | ||
369 | #endif | ||
370 | |||
366 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 371 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
367 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; | 372 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; |
368 | 373 | ||
@@ -811,7 +816,7 @@ static int __init kernel_init(void * unused) | |||
811 | /* | 816 | /* |
812 | * init can run on any cpu. | 817 | * init can run on any cpu. |
813 | */ | 818 | */ |
814 | set_cpus_allowed(current, CPU_MASK_ALL); | 819 | set_cpus_allowed_ptr(current, CPU_MASK_ALL_PTR); |
815 | /* | 820 | /* |
816 | * Tell the world that we're going to be the grim | 821 | * Tell the world that we're going to be the grim |
817 | * reaper of innocent orphaned children. | 822 | * reaper of innocent orphaned children. |