mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kunwu Chan <kunwu.chan@gmail.com>
To: paulmck@kernel.org, rcu@vger.kernel.org
Cc: dwmw2@infradead.org, jiangshanlai@gmail.com,
	josh@joshtriplett.org, work@onurozkan.dev, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, dave@stgolabs.net,
	jfern@kernel.org, frederic@kernel.org,
	neeraj.upadhyay@kernel.org, boqun@kernel.org, urezki@gmail.com,
	qiang.zhang@linux.dev, puranjay@kernel.org, shuah@kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Kunwu Chan <kunwu.chan@gmail.com>
Subject: [PATCH 11/17] rcutorture: Add consecutive expedited waits per writer iteration
Date: Wed,  2 Dec 2026 00:18:09 +0800	[thread overview]
Message-ID: <20261201161815.1637481-12-kunwu.chan@gmail.com> (raw)
In-Reply-To: <20261201161815.1637481-1-kunwu.chan@gmail.com>

The writer normally delays and publishes a new object between
expedited waits. Allow multiple waits per iteration, defaulting to
one. Advance the retired-object pipeline after every wait.

Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
---
 Documentation/admin-guide/kernel-parameters.txt |  5 +++++
 kernel/rcu/rcutorture.c                         | 14 ++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a49523c52c75..b30a473a35a6 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6148,6 +6148,11 @@ Kernel parameters
 	rcutorture.gp_exp= [KNL]
 			Use expedited update-side primitives, if available.
 
+	rcutorture.gp_exp_burst= [KNL]
+			Number of consecutive synchronous expedited waits
+			per writer iteration.  Defaults to one; values below
+			one also perform one update.
+
 	rcutorture.gp_normal= [KNL]
 			Use normal (non-expedited) asynchronous
 			update-side primitives, if available.
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 3b01c2e5bb5a..8905abe8725e 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -102,6 +102,7 @@ torture_param(int, gp_cond_wi, 16 * USEC_PER_SEC / HZ,
 torture_param(int, gp_cond_wi_exp, 128,
 		   "Wait interval for expedited conditional grace periods, us (default 128 us)");
 torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
+torture_param(int, gp_exp_burst, 1, "Number of consecutive expedited waits (minimum 1)");
 torture_param(bool, gp_normal, false, "Use normal (non-expedited) GP wait primitives");
 torture_param(bool, gp_poll, false, "Use polling GP wait primitives");
 torture_param(bool, gp_poll_exp, false, "Use polling expedited GP wait primitives");
@@ -1963,8 +1964,14 @@ rcu_torture_writer(void *arg)
 				break;
 			case RTWS_EXP_SYNC:
 				rcu_torture_writer_state = RTWS_EXP_SYNC;
+				/* Retire the old object even at shutdown. */
 				do_rtws_sync(&rand, cur_ops->exp_sync);
 				rcu_torture_pipe_update(old_rp);
+				for (i = 1; i < gp_exp_burst && !torture_must_stop(); i++) {
+					cond_resched();
+					do_rtws_sync(&rand, cur_ops->exp_sync);
+					rcu_torture_pipe_update(NULL);
+				}
 				break;
 			case RTWS_COND_GET:
 				rcu_torture_writer_state = RTWS_COND_GET;
@@ -3531,8 +3538,7 @@ static void rcu_torture_mem_dump_obj(void)
 static void
 rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag)
 {
-	pr_alert("%s" TORTURE_FLAG
-		 "--- %s: nreaders=%d nwriters=%d nfakewriters=%d "
+	pr_alert("%s%s--- %s: nreaders=%d nwriters=%d nfakewriters=%d gp_exp_burst=%d "
 		 "stat_interval=%d verbose=%d test_no_idle_hz=%d "
 		 "shuffle_interval=%d stutter=%d irqreader=%d "
 		 "fqs_duration=%d fqs_holdoff=%d fqs_stutter=%d "
@@ -3547,8 +3553,8 @@ rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag)
 		 "nocbs_nthreads=%d nocbs_toggle=%d "
 		 "test_nmis=%d nmi_calls=%d "
 		 "preempt_duration=%d preempt_interval=%d n_up_down=%d\n",
-		 torture_type, tag, nrealreaders, nwriters, nrealfakewriters,
-		 stat_interval, verbose, test_no_idle_hz, shuffle_interval,
+		 torture_type, TORTURE_FLAG, tag, nrealreaders, nwriters, nrealfakewriters,
+		 gp_exp_burst, stat_interval, verbose, test_no_idle_hz, shuffle_interval,
 		 stutter, irqreader, fqs_duration, fqs_holdoff, fqs_stutter,
 		 test_boost, cur_ops->can_boost,
 		 test_boost_interval, test_boost_duration, test_boost_holdoff, shutdown_secs,
-- 
2.43.0


  parent reply	other threads:[~2026-12-01 16:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 16:17 [PATCH 00/17] srcu: Try idle expedited GPs in the caller Kunwu Chan
2026-12-01 16:17 ` [PATCH 01/17] srcu: Move callback mutex acquisition to the GP end wrapper Kunwu Chan
2026-12-01 16:18 ` [PATCH 02/17] srcu: Let GP completion take a size-state snapshot Kunwu Chan
2026-12-01 16:18 ` [PATCH 03/17] srcu: Try idle expedited GPs in the caller Kunwu Chan
2026-12-01 16:18 ` [PATCH 04/17] srcu: Check only the boot CPU callback queue in SMALL domains Kunwu Chan
2026-12-01 16:18 ` [PATCH 05/17] rcutorture: Add selftests for console writer progress Kunwu Chan
2026-12-01 16:18 ` [PATCH 06/17] rcutorture: Compare console version counters exactly Kunwu Chan
2026-12-01 16:18 ` [PATCH 07/17] rcutorture: Recognize completed writer waits in console logs Kunwu Chan
2026-12-01 16:18 ` [PATCH 08/17] rcutorture: Emit the version with the statistics prefix Kunwu Chan
2026-12-01 16:18 ` [PATCH 09/17] rcutorture: Report completed synchronous writer waits Kunwu Chan
2026-12-01 16:18 ` [PATCH 10/17] rcutorture: Use writer wait counts in kernel stall diagnostics Kunwu Chan
2026-12-01 16:18 ` Kunwu Chan [this message]
2026-12-01 16:18 ` [PATCH 12/17] rcutorture: Check NMI coverage Kunwu Chan
2026-12-01 16:18 ` [PATCH 13/17] rcutorture: Test NMI coverage result classification Kunwu Chan
2026-12-01 16:18 ` [PATCH 14/17] rcutorture: Test NMI summary field validation Kunwu Chan
2026-12-01 16:18 ` [PATCH 15/17] rcutorture: Test NMI console-log boundaries Kunwu Chan
2026-12-01 16:18 ` [PATCH 16/17] rcutorture: Document how to check SRCU NMI coverage Kunwu Chan
2026-12-01 16:18 ` [PATCH 17/17] rcutorture: Document directed SRCU NMI tests Kunwu Chan

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=20261201161815.1637481-12-kunwu.chan@gmail.com \
    --to=kunwu.chan@gmail.com \
    --cc=boqun@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dwmw2@infradead.org \
    --cc=frederic@kernel.org \
    --cc=jfern@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.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=puranjay@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=urezki@gmail.com \
    --cc=work@onurozkan.dev \
    /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®