diff options
author | Ricardo M. Correia <[email protected]> | 2010-07-20 15:44:28 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-07-20 15:49:25 -0700 |
commit | 15b52c083ee886d9cb102655b4313ae7c027784a (patch) | |
tree | eeb464794e10b7be9584b82416844a1408aa544c /include | |
parent | 81672c012249f1ba81a27a1ff8f9b19b4a8048a8 (diff) |
Fix max_ncpus definition.
It was being defined as the constant 64 and at first I changed it to be
NR_CPUS instead.
However, NR_CPUS can be a large value on recent kernels (4096), and this
may cause too large kmem allocations to happen.
Therefore, now we use num_possible_cpus(), which should return a (typically)
small value which represents the maximum number of CPUs than can be brought
online in the running hardware (this value is determined at boot time by
arch-specific kernel code).
Signed-off-by: Ricardo M. Correia <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/sysmacros.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index eded9abc0..d9647b3cd 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -26,6 +26,7 @@ #define _SPL_SYSMACROS_H #include <linux/module.h> +#include <linux/cpumask.h> #include <sys/debug.h> #include <sys/varargs.h> #include <sys/zone.h> @@ -77,8 +78,8 @@ #define proc_pageout NULL #define curproc get_current() -#define max_ncpus 64 -#define CPU_SEQID smp_processor_id() /* I think... */ +#define max_ncpus num_possible_cpus() +#define CPU_SEQID smp_processor_id() #define _NOTE(x) #define is_system_labeled() 0 |