]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Fix max_ncpus definition.
authorRicardo M. Correia <ricardo.correia@oracle.com>
Tue, 20 Jul 2010 22:44:28 +0000 (15:44 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 20 Jul 2010 22:49:25 +0000 (15:49 -0700)
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 <ricardo.correia@oracle.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/sysmacros.h

index eded9abc0539232ffd8fc81b423fe4af0b781621..d9647b3cd5f8b85edbdbefaf7fd61976aeb6c0c3 100644 (file)
@@ -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