Skip to content

Commit

Permalink
cpumask: make CONFIG_NR_CPUS always valid.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell committed Dec 29, 2008
1 parent 33edcf1 commit 278d1ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/linux/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
*/

/*
* Maximum supported processors that can run under SMP. This value is
* set via configure setting. The maximum is equal to the size of the
* bitmasks used on that platform, i.e. 32 or 64. Setting this smaller
* saves quite a bit of memory.
* Maximum supported processors. Setting this smaller saves quite a
* bit of memory. Use nr_cpu_ids instead of this except for static bitmaps.
*/
#ifdef CONFIG_SMP
#define NR_CPUS CONFIG_NR_CPUS
#else
#define NR_CPUS 1
#ifndef CONFIG_NR_CPUS
/* FIXME: This should be fixed in the arch's Kconfig */
#define CONFIG_NR_CPUS 1
#endif

/* Places which use this should consider cpumask_var_t. */
#define NR_CPUS CONFIG_NR_CPUS

#define MIN_THREADS_LEFT_FOR_ROOT 4

/*
Expand Down

0 comments on commit 278d1ed

Please sign in to comment.