From 15b52c083ee886d9cb102655b4313ae7c027784a Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 20 Jul 2010 15:44:28 -0700 Subject: [PATCH] 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 Signed-off-by: Brian Behlendorf --- include/sys/sysmacros.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index eded9abc..d9647b3c 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -26,6 +26,7 @@ #define _SPL_SYSMACROS_H #include +#include #include #include #include @@ -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