diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-05-09 00:00:28 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-02 15:33:21 -0400 |
commit | cca6f3931920a7547d02e68adc2ca635bea5600c (patch) | |
tree | 31e2cd3d9e73f080ca78a89a6dba474c1987beee /kernel/rcutree.c | |
parent | cc5df65b0370fc6aa2bfe3bb19e0451d5cafb99f (diff) |
rcu: Size rcu_node tree from nr_cpu_ids rather than NR_CPUS
The rcu_node tree array is sized based on compile-time constants,
including NR_CPUS. Although this approach has worked well in the past,
the recent trend by many distros to define NR_CPUS=4096 results in
excessive grace-period-initialization latencies.
This commit therefore substitutes the run-time computed nr_cpu_ids for
the compile-time NR_CPUS when building the tree. This can result in
much of the compile-time-allocated rcu_node array being unused. If
this is a major problem, you are in a specialized situation anyway,
so you can manually adjust the NR_CPUS, RCU_FANOUT, and RCU_FANOUT_LEAF
kernel config parameters.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index a4c592b66e10..0fdbc5e07302 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -2675,7 +2675,7 @@ static void __init rcu_init_geometry(void) | |||
2675 | { | 2675 | { |
2676 | int i; | 2676 | int i; |
2677 | int j; | 2677 | int j; |
2678 | int n = NR_CPUS; | 2678 | int n = nr_cpu_ids; |
2679 | int rcu_capacity[MAX_RCU_LVLS + 1]; | 2679 | int rcu_capacity[MAX_RCU_LVLS + 1]; |
2680 | 2680 | ||
2681 | /* If the compile-time values are accurate, just leave. */ | 2681 | /* If the compile-time values are accurate, just leave. */ |