The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joel Fernandes <jfern@kernel.org>
To: paulmck@kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
	Boqun Feng <boqun@kernel.org>, Joel Fernandes <jfern@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang@linux.dev>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH v3 5/6] rcutorture: Add boost_disable to disable RCU priority boosting
Date: Sat, 21 Nov 2026 10:35:51 -0500	[thread overview]
Message-ID: <20261121153552.68941-6-jfern@kernel.org> (raw)
In-Reply-To: <20261121153552.68941-1-jfern@kernel.org>

CONFIG_RCU_BOOST is now enabled automatically for preemptible RCU and
cannot be turned off, so rcutorture's BUSTED-BOOST scenario, which is
meant to show that rcutorture detects broken priority boosting, can no
longer break it.  Add an rcutorture.boost_disable parameter that keeps
rcu_spawn_one_boost_kthread() from creating the boost kthreads, which
gives that scenario a way to break boosting.

The parameter only has an effect when rcutorture is built in, because
the kthreads are created during boot.  Document it in
kernel-parameters.txt.

[ jfern: Apply feedback from Sebastian to not create the boost kthread ]
[ jfern: Apply feedback from Sebastian to limit this to rcutorture ]
[ jfern: Apply feedback from Sebastian to fold the docs into this patch ]

Signed-off-by: Joel Fernandes <jfern@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
---
 Documentation/admin-guide/kernel-parameters.txt | 9 +++++++++
 kernel/rcu/rcu.h                                | 1 +
 kernel/rcu/rcutorture.c                         | 5 +++++
 kernel/rcu/tree_plugin.h                        | 4 ++++
 4 files changed, 19 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index ac97cbd98b46..40e18ee3a1ba 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5964,6 +5964,15 @@ Kernel parameters
 			periods, but in jiffies.  The default of zero
 			says no holdoff.
 
+	rcutorture.boost_disable= [KNL]
+			Do not create the RCU priority-boost kthreads, so
+			that RCU priority boosting never happens.  This
+			is for testing that rcutorture detects broken
+			boosting, as in the BUSTED-BOOST scenario, and
+			should not be used otherwise.  It has an effect
+			only if rcutorture is built in, because the
+			kthreads are created during boot.
+
 	rcutorture.fqs_duration= [KNL]
 			Set duration of force_quiescent_state bursts
 			in microseconds.
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index 93542e30b7f4..c01423985e3b 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -716,5 +716,6 @@ bool rcu_is_task_rcu_boosted(void);
 static inline bool rcu_is_task_rcu_boosted(void) { return false; }
 #endif // #else // #if defined(CONFIG_RCU_TORTURE_TEST) && defined(CONFIG_RCU_BOOST)
 
+extern bool rcu_torture_boost_disable;
 
 #endif /* __LINUX_RCU_H */
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index ff674ace50a6..e5dbc77b09d5 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -158,6 +158,11 @@ static char *torture_type = "rcu";
 module_param(torture_type, charp, 0444);
 MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, srcu, ...)");
 
+// Global because tree_plugin.h reads it during boot.
+bool rcu_torture_boost_disable;
+module_param_named(boost_disable, rcu_torture_boost_disable, bool, 0444);
+MODULE_PARM_DESC(boost_disable, "Do not create RCU boost kthreads, to test boost-failure detection.");
+
 static int nrealnocbers;
 static int nrealreaders;
 static int nrealfakewriters;
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index ae5d21bae7bc..3500e4874833 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1329,6 +1329,10 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp)
 	if (rnp->boost_kthread_task)
 		return;
 
+	// With no boost kthread, rcu_initiate_boost() never boosts.
+	if (IS_BUILTIN(CONFIG_RCU_TORTURE_TEST) && rcu_torture_boost_disable)
+		return;
+
 	t = kthread_create(rcu_boost_kthread, (void *)rnp,
 			   "rcub/%d", rnp_index);
 	if (WARN_ON_ONCE(IS_ERR(t)))
-- 
2.54.0


  parent reply	other threads:[~2026-11-21 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 15:35 [PATCH v3 0/6] rcutorture: Rewrite RCU priority-boost test around a CPU-hungry reader Joel Fernandes
2026-11-21 15:35 ` [PATCH v3 1/6] " Joel Fernandes
2026-11-21 15:35 ` [PATCH v3 2/6] rcutorture: Don't try to disable to RT throttling Joel Fernandes
2026-11-21 15:35 ` [PATCH v3 3/6] rcutorture: Remove unused check_boost_failed hook Joel Fernandes
2026-11-21 15:35 ` [PATCH v3 4/6] doc: Document rcutorture.test_boost_reader_ms Joel Fernandes
2026-11-21 15:35 ` Joel Fernandes [this message]
2026-11-21 15:35 ` [PATCH v3 6/6] rcutorture: Make BUSTED-BOOST disable RCU priority boosting Joel Fernandes

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=20261121153552.68941-6-jfern@kernel.org \
    --to=jfern@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=boqun@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dave@stgolabs.net \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=urezki@gmail.com \
    /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