mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com,
	bobby.prani@gmail.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 04/12] rcu: Covert CONFIG_RCU_FANOUT_EXACT to boot parameter
Date: Tue, 21 Apr 2015 12:55:45 -0700	[thread overview]
Message-ID: <1429646153-20677-4-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <1429646153-20677-1-git-send-email-paulmck@linux.vnet.ibm.com>

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

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>
---
 Documentation/kernel-parameters.txt |  6 ++++++
 init/Kconfig                        | 14 --------------
 kernel/rcu/tree.c                   |  7 +++++--
 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 64528a2fc67c..24b0d95acd45 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2986,6 +2986,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			the rcu_node combining tree.  This only has effect
 			when CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT is set.
 
+	rcutree.rcu_fanout_exact= [KNL]
+			Disable autobalancing of the rcu_node combining
+			tree.  This is used by rcutorture, and might
+			possibly be useful for architectures having high
+			cache-to-cache transfer latencies.
+
 	rcutree.rcu_fanout_leaf= [KNL]
 			Increase the number of CPUs assigned to each
 			leaf rcu_node structure.  Useful for very large
diff --git a/init/Kconfig b/init/Kconfig
index 6d2cf6453be7..67598f3143f5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -609,20 +609,6 @@ config RCU_FANOUT_LEAF
 
 	  Take the default if unsure.
 
-config RCU_FANOUT_EXACT
-	bool "Disable tree-based hierarchical RCU auto-balancing"
-	depends on TREE_RCU || PREEMPT_RCU
-	default n
-	help
-	  This option forces use of the exact RCU_FANOUT value specified,
-	  regardless of imbalances in the hierarchy.  This is useful for
-	  testing RCU itself, and might one day be useful on systems with
-	  strong NUMA behavior.
-
-	  Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
-
-	  Say N if unsure.
-
 config RCU_FAST_NO_HZ
 	bool "Accelerate last non-dyntick-idle CPU's grace periods"
 	depends on NO_HZ_COMMON && SMP
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 3467e321280c..fdca17e7a1b5 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -114,6 +114,9 @@ static struct rcu_state *const rcu_state_p;
 static struct rcu_data __percpu *const rcu_data_p;
 LIST_HEAD(rcu_struct_flavors);
 
+/* Control rcu_node-tree auto-balancing at boot time. */
+static bool rcu_fanout_exact;
+module_param(rcu_fanout_exact, bool, 0444);
 /* Increase (but not decrease) the CONFIG_RCU_FANOUT_LEAF at boot time. */
 static int rcu_fanout_leaf = CONFIG_RCU_FANOUT_LEAF;
 module_param(rcu_fanout_leaf, int, 0444);
@@ -3937,13 +3940,13 @@ void rcu_scheduler_starting(void)
 
 /*
  * Compute the per-level fanout, either using the exact fanout specified
- * or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT.
+ * or balancing the tree, depending on the rcu_fanout_exact boot parameter.
  */
 static void __init rcu_init_levelspread(int *levelspread, const int *levelcnt)
 {
 	int i;
 
-	if (IS_ENABLED(CONFIG_RCU_FANOUT_EXACT)) {
+	if (rcu_fanout_exact) {
 		levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
 		for (i = rcu_num_lvls - 2; i >= 0; i--)
 			levelspread[i] = CONFIG_RCU_FANOUT;
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index e6ef194da4b7..074689cedda9 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -74,7 +74,7 @@ static void __init rcu_bootup_announce_oddness(void)
 	    (!IS_ENABLED(CONFIG_64BIT) && CONFIG_RCU_FANOUT != 32))
 		pr_info("\tCONFIG_RCU_FANOUT set to non-default value of %d\n",
 		       CONFIG_RCU_FANOUT);
-	if (IS_ENABLED(CONFIG_RCU_FANOUT_EXACT))
+	if (rcu_fanout_exact)
 		pr_info("\tHierarchical RCU autobalancing is disabled.\n");
 	if (IS_ENABLED(CONFIG_RCU_FAST_NO_HZ))
 		pr_info("\tRCU dyntick-idle grace-period acceleration is enabled.\n");
-- 
1.8.1.5


  parent reply	other threads:[~2015-04-21 19:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 19:55 [PATCH tip/core/rcu 0/12] RCU Kconfig fixes for v4.2 Paul E. McKenney
2015-04-21 19:55 ` [PATCH tip/core/rcu 01/12] rcu: Directly drive TASKS_RCU from Kconfig Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 02/12] rcutorture: TASKS_RCU set directly, so don't explicitly set it Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 03/12] rcu: Directly drive RCU_USER_QS from Kconfig Paul E. McKenney
2015-04-21 19:55   ` Paul E. McKenney [this message]
2015-04-21 19:55   ` [PATCH tip/core/rcu 05/12] rcutorture: Update configuration fragments for rcutree.rcu_fanout_exact Paul E. McKenney
2015-04-22  5:08     ` Pranith Kumar
2015-04-22 14:24       ` Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 06/12] rcu: Enable diagnostic dump of rcu_node combining tree Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 07/12] rcu: Create RCU_EXPERT Kconfig and hide booleans behind it Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 08/12] rcutorture: Make rcutorture scripts force RCU_EXPERT Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 09/12] rcu: Break dependency of RCU_FANOUT_LEAF on RCU_FANOUT Paul E. McKenney
2015-04-22  5:22     ` Pranith Kumar
2015-04-22 14:30       ` Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 10/12] rcu: Make RCU able to tolerate undefined CONFIG_RCU_FANOUT Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 11/12] rcu: Make RCU able to tolerate undefined CONFIG_RCU_FANOUT_LEAF Paul E. McKenney
2015-04-22  5:25     ` Pranith Kumar
2015-04-22 14:30       ` Paul E. McKenney
2015-04-21 19:55   ` [PATCH tip/core/rcu 12/12] rcu: Make RCU able to tolerate undefined CONFIG_RCU_KTHREAD_PRIO Paul E. McKenney
2015-04-22  5:26 ` [PATCH tip/core/rcu 0/12] RCU Kconfig fixes for v4.2 Pranith Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429646153-20677-4-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bobby.prani@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhart@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®