aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/threads.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:12 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:12 -0500
commit278d1ed65e25d80af7c3a112d707b3f70516ddb4 (patch)
tree633c75759731d5e1c2a0fb7d4c187bc3782c6285 /include/linux/threads.h
parent33edcf133ba93ecba2e4b6472e97b689895d805c (diff)
cpumask: make CONFIG_NR_CPUS always valid.
Impact: cleanup Currently we have NR_CPUS, which is 1 on UP, and CONFIG_NR_CPUS on SMP. If we make CONFIG_NR_CPUS always valid (and always 1 on !SMP), we can skip the middleman. This also allows us to find and check all the unaudited NR_CPUS usage as we prepare for v. large NR_CPUS. To avoid breaking every arch, we cheat and do this for the moment in the header if the arch doesn't. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'include/linux/threads.h')
-rw-r--r--include/linux/threads.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/threads.h b/include/linux/threads.h
index 38d1a5d6568e..052b12bec8bd 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -8,17 +8,17 @@
8 */ 8 */
9 9
10/* 10/*
11 * Maximum supported processors that can run under SMP. This value is 11 * Maximum supported processors. Setting this smaller saves quite a
12 * set via configure setting. The maximum is equal to the size of the 12 * bit of memory. Use nr_cpu_ids instead of this except for static bitmaps.
13 * bitmasks used on that platform, i.e. 32 or 64. Setting this smaller
14 * saves quite a bit of memory.
15 */ 13 */
16#ifdef CONFIG_SMP 14#ifndef CONFIG_NR_CPUS
17#define NR_CPUS CONFIG_NR_CPUS 15/* FIXME: This should be fixed in the arch's Kconfig */
18#else 16#define CONFIG_NR_CPUS 1
19#define NR_CPUS 1
20#endif 17#endif
21 18
19/* Places which use this should consider cpumask_var_t. */
20#define NR_CPUS CONFIG_NR_CPUS
21
22#define MIN_THREADS_LEFT_FOR_ROOT 4 22#define MIN_THREADS_LEFT_FOR_ROOT 4
23 23
24/* 24/*