diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-04-20 13:27:15 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-05-27 15:59:04 -0400 |
commit | 7fa270010e0ddd3693381431f373b3e3135b0695 (patch) | |
tree | 896b3eaa0bbc48b80ca45b4e01711699e7e1199f | |
parent | 7db21edfecb079b2257ced7a2cf2e32ae5e5d966 (diff) |
rcu: Convert CONFIG_RCU_FANOUT_EXACT to boot parameter
The CONFIG_RCU_FANOUT_EXACT Kconfig parameter is used primarily (and
perhaps only) by rcutorture to verify that RCU works correctly in specific
rcu_node combining-tree configurations. It therefore does not make
much sense have this as a question to people attempting to configure
their kernels. So this commit creates an rcutree.rcu_fanout_exact=
boot parameter that rcutorture can use, and eliminates the original
CONFIG_RCU_FANOUT_EXACT Kconfig parameter.
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>
-rw-r--r-- | Documentation/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | init/Kconfig | 14 | ||||
-rw-r--r-- | kernel/rcu/tree.c | 7 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 2 |
4 files changed, 12 insertions, 17 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 10a4fb80c033..f5582dcdf80d 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -3010,6 +3010,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
3010 | the rcu_node combining tree. This only has effect | 3010 | the rcu_node combining tree. This only has effect |
3011 | when CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT is set. | 3011 | when CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT is set. |
3012 | 3012 | ||
3013 | rcutree.rcu_fanout_exact= [KNL] | ||
3014 | Disable autobalancing of the rcu_node combining | ||
3015 | tree. This is used by rcutorture, and might | ||
3016 | possibly be useful for architectures having high | ||
3017 | cache-to-cache transfer latencies. | ||
3018 | |||
3013 | rcutree.rcu_fanout_leaf= [KNL] | 3019 | rcutree.rcu_fanout_leaf= [KNL] |
3014 | Increase the number of CPUs assigned to each | 3020 | Increase the number of CPUs assigned to each |
3015 | leaf rcu_node structure. Useful for very large | 3021 | leaf rcu_node structure. Useful for very large |
diff --git a/init/Kconfig b/init/Kconfig index 927210810189..0ec82362cfc0 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -611,20 +611,6 @@ config RCU_FANOUT_LEAF | |||
611 | 611 | ||
612 | Take the default if unsure. | 612 | Take the default if unsure. |
613 | 613 | ||
614 | config RCU_FANOUT_EXACT | ||
615 | bool "Disable tree-based hierarchical RCU auto-balancing" | ||
616 | depends on TREE_RCU || PREEMPT_RCU | ||
617 | default n | ||
618 | help | ||
619 | This option forces use of the exact RCU_FANOUT value specified, | ||
620 | regardless of imbalances in the hierarchy. This is useful for | ||
621 | testing RCU itself, and might one day be useful on systems with | ||
622 | strong NUMA behavior. | ||
623 | |||
624 | Without RCU_FANOUT_EXACT, the code will balance the hierarchy. | ||
625 | |||
626 | Say N if unsure. | ||
627 | |||
628 | config RCU_FAST_NO_HZ | 614 | config RCU_FAST_NO_HZ |
629 | bool "Accelerate last non-dyntick-idle CPU's grace periods" | 615 | bool "Accelerate last non-dyntick-idle CPU's grace periods" |
630 | depends on NO_HZ_COMMON && SMP | 616 | depends on NO_HZ_COMMON && SMP |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 2f3cb5513ca3..b49c474e1fff 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -113,6 +113,9 @@ RCU_STATE_INITIALIZER(rcu_bh, 'b', call_rcu_bh); | |||
113 | static struct rcu_state *rcu_state_p; | 113 | static struct rcu_state *rcu_state_p; |
114 | LIST_HEAD(rcu_struct_flavors); | 114 | LIST_HEAD(rcu_struct_flavors); |
115 | 115 | ||
116 | /* Control rcu_node-tree auto-balancing at boot time. */ | ||
117 | static bool rcu_fanout_exact; | ||
118 | module_param(rcu_fanout_exact, bool, 0444); | ||
116 | /* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */ | 119 | /* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */ |
117 | static int rcu_fanout_leaf = CONFIG_RCU_FANOUT_LEAF; | 120 | static int rcu_fanout_leaf = CONFIG_RCU_FANOUT_LEAF; |
118 | module_param(rcu_fanout_leaf, int, 0444); | 121 | module_param(rcu_fanout_leaf, int, 0444); |
@@ -3956,13 +3959,13 @@ void rcu_scheduler_starting(void) | |||
3956 | 3959 | ||
3957 | /* | 3960 | /* |
3958 | * Compute the per-level fanout, either using the exact fanout specified | 3961 | * Compute the per-level fanout, either using the exact fanout specified |
3959 | * or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT. | 3962 | * or balancing the tree, depending on the rcu_fanout_exact boot parameter. |
3960 | */ | 3963 | */ |
3961 | static void __init rcu_init_levelspread(struct rcu_state *rsp) | 3964 | static void __init rcu_init_levelspread(struct rcu_state *rsp) |
3962 | { | 3965 | { |
3963 | int i; | 3966 | int i; |
3964 | 3967 | ||
3965 | if (IS_ENABLED(CONFIG_RCU_FANOUT_EXACT)) { | 3968 | if (rcu_fanout_exact) { |
3966 | rsp->levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf; | 3969 | rsp->levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf; |
3967 | for (i = rcu_num_lvls - 2; i >= 0; i--) | 3970 | for (i = rcu_num_lvls - 2; i >= 0; i--) |
3968 | rsp->levelspread[i] = CONFIG_RCU_FANOUT; | 3971 | rsp->levelspread[i] = CONFIG_RCU_FANOUT; |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 58b1ebdc4387..eb460ec747ef 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -64,7 +64,7 @@ static void __init rcu_bootup_announce_oddness(void) | |||
64 | (!IS_ENABLED(CONFIG_64BIT) && CONFIG_RCU_FANOUT != 32)) | 64 | (!IS_ENABLED(CONFIG_64BIT) && CONFIG_RCU_FANOUT != 32)) |
65 | pr_info("\tCONFIG_RCU_FANOUT set to non-default value of %d\n", | 65 | pr_info("\tCONFIG_RCU_FANOUT set to non-default value of %d\n", |
66 | CONFIG_RCU_FANOUT); | 66 | CONFIG_RCU_FANOUT); |
67 | if (IS_ENABLED(CONFIG_RCU_FANOUT_EXACT)) | 67 | if (rcu_fanout_exact) |
68 | pr_info("\tHierarchical RCU autobalancing is disabled.\n"); | 68 | pr_info("\tHierarchical RCU autobalancing is disabled.\n"); |
69 | if (IS_ENABLED(CONFIG_RCU_FAST_NO_HZ)) | 69 | if (IS_ENABLED(CONFIG_RCU_FAST_NO_HZ)) |
70 | pr_info("\tRCU dyntick-idle grace-period acceleration is enabled.\n"); | 70 | pr_info("\tRCU dyntick-idle grace-period acceleration is enabled.\n"); |