diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-04-21 12:12:13 -0400 | 
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-05-27 15:59:05 -0400 | 
| commit | 47d631af58bb9b2f2dd3d0da8c98a79a5e75c738 (patch) | |
| tree | 7472330c70684ac02140d2f3796b042b53a4f6dd /kernel/rcu/tree.c | |
| parent | 05c5df31afd1092ca6322094d22aff6351fa67fe (diff) | |
rcu: Make RCU able to tolerate undefined CONFIG_RCU_FANOUT_LEAF
This commit introduces an RCU_FANOUT_LEAF C-preprocessor macro so
that RCU will build even when CONFIG_RCU_FANOUT_LEAF is undefined.
The RCU_FANOUT_LEAF macro is set to the value of CONFIG_RCU_FANOUT_LEAF
when defined, otherwise it is set to 32 for 32-bit systems and 64 for
64-bit systems.  This commit then makes CONFIG_RCU_FANOUT_LEAF depend
on CONFIG_RCU_EXPERT, so that Kconfig users won't be asked about
CONFIG_RCU_FANOUT_LEAF unless they want to be.
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
Diffstat (limited to 'kernel/rcu/tree.c')
| -rw-r--r-- | kernel/rcu/tree.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index ba3f8d59d948..1edd11298224 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
| @@ -119,8 +119,8 @@ module_param(dump_tree, bool, 0444); | |||
| 119 | /* Control rcu_node-tree auto-balancing at boot time. */ | 119 | /* Control rcu_node-tree auto-balancing at boot time. */ | 
| 120 | static bool rcu_fanout_exact; | 120 | static bool rcu_fanout_exact; | 
| 121 | module_param(rcu_fanout_exact, bool, 0444); | 121 | module_param(rcu_fanout_exact, bool, 0444); | 
| 122 | /* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */ | 122 | /* Increase (but not decrease) the RCU_FANOUT_LEAF at boot time. */ | 
| 123 | static int rcu_fanout_leaf = CONFIG_RCU_FANOUT_LEAF; | 123 | static int rcu_fanout_leaf = RCU_FANOUT_LEAF; | 
| 124 | module_param(rcu_fanout_leaf, int, 0444); | 124 | module_param(rcu_fanout_leaf, int, 0444); | 
| 125 | int rcu_num_lvls __read_mostly = RCU_NUM_LVLS; | 125 | int rcu_num_lvls __read_mostly = RCU_NUM_LVLS; | 
| 126 | static int num_rcu_lvl[] = { /* Number of rcu_nodes at specified level. */ | 126 | static int num_rcu_lvl[] = { /* Number of rcu_nodes at specified level. */ | 
| @@ -4097,7 +4097,7 @@ static void __init rcu_init_geometry(void) | |||
| 4097 | jiffies_till_next_fqs = d; | 4097 | jiffies_till_next_fqs = d; | 
| 4098 | 4098 | ||
| 4099 | /* If the compile-time values are accurate, just leave. */ | 4099 | /* If the compile-time values are accurate, just leave. */ | 
| 4100 | if (rcu_fanout_leaf == CONFIG_RCU_FANOUT_LEAF && | 4100 | if (rcu_fanout_leaf == RCU_FANOUT_LEAF && | 
| 4101 | nr_cpu_ids == NR_CPUS) | 4101 | nr_cpu_ids == NR_CPUS) | 
| 4102 | return; | 4102 | return; | 
| 4103 | pr_info("RCU: Adjusting geometry for rcu_fanout_leaf=%d, nr_cpu_ids=%d\n", | 4103 | pr_info("RCU: Adjusting geometry for rcu_fanout_leaf=%d, nr_cpu_ids=%d\n", | 
| @@ -4121,7 +4121,7 @@ static void __init rcu_init_geometry(void) | |||
| 4121 | * the configured number of CPUs. Complain and fall back to the | 4121 | * the configured number of CPUs. Complain and fall back to the | 
| 4122 | * compile-time values if these limits are exceeded. | 4122 | * compile-time values if these limits are exceeded. | 
| 4123 | */ | 4123 | */ | 
| 4124 | if (rcu_fanout_leaf < CONFIG_RCU_FANOUT_LEAF || | 4124 | if (rcu_fanout_leaf < RCU_FANOUT_LEAF || | 
| 4125 | rcu_fanout_leaf > sizeof(unsigned long) * 8 || | 4125 | rcu_fanout_leaf > sizeof(unsigned long) * 8 || | 
| 4126 | n > rcu_capacity[MAX_RCU_LVLS]) { | 4126 | n > rcu_capacity[MAX_RCU_LVLS]) { | 
| 4127 | WARN_ON(1); | 4127 | WARN_ON(1); | 
