aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/Kconfig2
-rw-r--r--kernel/rcu/tree.c8
-rw-r--r--kernel/rcu/tree.h12
-rw-r--r--kernel/rcu/tree_plugin.h6
4 files changed, 19 insertions, 9 deletions
diff --git a/init/Kconfig b/init/Kconfig
index fd2d4fb517ca..78176001f73b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -603,7 +603,7 @@ config RCU_FANOUT_LEAF
603 int "Tree-based hierarchical RCU leaf-level fanout value" 603 int "Tree-based hierarchical RCU leaf-level fanout value"
604 range 2 64 if 64BIT 604 range 2 64 if 64BIT
605 range 2 32 if !64BIT 605 range 2 32 if !64BIT
606 depends on TREE_RCU || PREEMPT_RCU 606 depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
607 default 16 607 default 16
608 help 608 help
609 This option controls the leaf-level fanout of hierarchical 609 This option controls the leaf-level fanout of hierarchical
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. */
120static bool rcu_fanout_exact; 120static bool rcu_fanout_exact;
121module_param(rcu_fanout_exact, bool, 0444); 121module_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. */
123static int rcu_fanout_leaf = CONFIG_RCU_FANOUT_LEAF; 123static int rcu_fanout_leaf = RCU_FANOUT_LEAF;
124module_param(rcu_fanout_leaf, int, 0444); 124module_param(rcu_fanout_leaf, int, 0444);
125int rcu_num_lvls __read_mostly = RCU_NUM_LVLS; 125int rcu_num_lvls __read_mostly = RCU_NUM_LVLS;
126static int num_rcu_lvl[] = { /* Number of rcu_nodes at specified level. */ 126static 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);
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index ac3020fff028..7d949c186302 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -48,7 +48,17 @@
48# endif 48# endif
49#endif /* #else #ifdef CONFIG_RCU_FANOUT */ 49#endif /* #else #ifdef CONFIG_RCU_FANOUT */
50 50
51#define RCU_FANOUT_1 (CONFIG_RCU_FANOUT_LEAF) 51#ifdef CONFIG_RCU_FANOUT_LEAF
52#define RCU_FANOUT_LEAF CONFIG_RCU_FANOUT_LEAF
53#else /* #ifdef CONFIG_RCU_FANOUT_LEAF */
54# ifdef CONFIG_64BIT
55# define RCU_FANOUT_LEAF 64
56# else
57# define RCU_FANOUT_LEAF 32
58# endif
59#endif /* #else #ifdef CONFIG_RCU_FANOUT_LEAF */
60
61#define RCU_FANOUT_1 (RCU_FANOUT_LEAF)
52#define RCU_FANOUT_2 (RCU_FANOUT_1 * RCU_FANOUT) 62#define RCU_FANOUT_2 (RCU_FANOUT_1 * RCU_FANOUT)
53#define RCU_FANOUT_3 (RCU_FANOUT_2 * RCU_FANOUT) 63#define RCU_FANOUT_3 (RCU_FANOUT_2 * RCU_FANOUT)
54#define RCU_FANOUT_4 (RCU_FANOUT_3 * RCU_FANOUT) 64#define RCU_FANOUT_4 (RCU_FANOUT_3 * RCU_FANOUT)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index d7e505970f24..713503853841 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -76,10 +76,10 @@ static void __init rcu_bootup_announce_oddness(void)
76 pr_info("\tAdditional per-CPU info printed with stalls.\n"); 76 pr_info("\tAdditional per-CPU info printed with stalls.\n");
77 if (NUM_RCU_LVL_4 != 0) 77 if (NUM_RCU_LVL_4 != 0)
78 pr_info("\tFour-level hierarchy is enabled.\n"); 78 pr_info("\tFour-level hierarchy is enabled.\n");
79 if (CONFIG_RCU_FANOUT_LEAF != 16) 79 if (RCU_FANOUT_LEAF != 16)
80 pr_info("\tBuild-time adjustment of leaf fanout to %d.\n", 80 pr_info("\tBuild-time adjustment of leaf fanout to %d.\n",
81 CONFIG_RCU_FANOUT_LEAF); 81 RCU_FANOUT_LEAF);
82 if (rcu_fanout_leaf != CONFIG_RCU_FANOUT_LEAF) 82 if (rcu_fanout_leaf != RCU_FANOUT_LEAF)
83 pr_info("\tBoot-time adjustment of leaf fanout to %d.\n", rcu_fanout_leaf); 83 pr_info("\tBoot-time adjustment of leaf fanout to %d.\n", rcu_fanout_leaf);
84 if (nr_cpu_ids != NR_CPUS) 84 if (nr_cpu_ids != NR_CPUS)
85 pr_info("\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); 85 pr_info("\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids);