Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Fix max_ncpus definition.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Ricardo M. Correia authored and behlendorf committed Jul 20, 2010
1 parent 81672c0 commit 15b52c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/sys/sysmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 15b52c0

Please sign in to comment.