mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH 10/11] rcutorture: Make RCU Tasks Trace track Reader Batches
Date: Wed, 15 Jul 2026 17:25:19 -0700	[thread overview]
Message-ID: <20260716002520.11895-10-paulmck@kernel.org> (raw)
In-Reply-To: <3f56c779-b900-40f9-9a24-6136fb28ddfb@paulmck-laptop>

This commit adds the ->get_sp_seq and ->gp_diff fields to the
tasks_tracing_ops structure so that RCU Tasks Trace rcutorture runs will
track Reader Batch.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 include/linux/rcupdate_trace.h | 3 +++
 kernel/rcu/rcutorture.c        | 3 ++-
 kernel/rcu/tasks.h             | 6 ++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/rcupdate_trace.h b/include/linux/rcupdate_trace.h
index cee89e51e45cbb..f2c4173bf14fde 100644
--- a/include/linux/rcupdate_trace.h
+++ b/include/linux/rcupdate_trace.h
@@ -198,10 +198,13 @@ static inline void rcu_tasks_trace_expedite_current(void)
 	srcu_expedite_current(&rcu_tasks_trace_srcu_struct);
 }
 
+unsigned long rcu_tasks_trace_batches_completed(void);
+
 // Placeholders to enable stepwise transition.
 void __init rcu_tasks_trace_suppress_unused(void);
 
 #else
+static inline unsigned long rcu_tasks_trace_batches_completed(void) { return 0; }
 /*
  * The BPF JIT forms these addresses even when it doesn't call these
  * functions, so provide definitions that result in runtime errors.
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index c8118c38812aee..8514fef3ec10b6 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1252,7 +1252,8 @@ static struct rcu_torture_ops tasks_tracing_ops = {
 	.read_delay	= srcu_read_delay,  /* just reuse srcu's version. */
 	.readunlock	= tasks_tracing_torture_read_unlock,
 	.readlock_held	= rcu_read_lock_trace_held,
-	.get_gp_seq	= rcu_no_completed,
+	.get_gp_seq	= rcu_tasks_trace_batches_completed,
+	.gp_diff	= rcu_seq_diff,
 	.deferred_free	= rcu_tasks_tracing_torture_deferred_free,
 	.sync		= synchronize_rcu_tasks_trace,
 	.exp_sync	= synchronize_rcu_tasks_trace,
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index f4da5fad70f516..496acac8796fa7 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1606,4 +1606,10 @@ static inline void rcu_tasks_bootup_oddness(void) {}
 DEFINE_SRCU_FAST(rcu_tasks_trace_srcu_struct);
 EXPORT_SYMBOL_GPL(rcu_tasks_trace_srcu_struct);
 
+unsigned long rcu_tasks_trace_batches_completed(void)
+{
+	return srcu_batches_completed(&rcu_tasks_trace_srcu_struct);
+}
+EXPORT_SYMBOL_GPL(rcu_tasks_trace_batches_completed);
+
 #endif /* #else #ifdef CONFIG_TASKS_TRACE_RCU */
-- 
2.40.1


  parent reply	other threads:[~2026-07-16  0:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  0:25 [PATCH 0/11] RCU torture-test updates for v7.3 Paul E. McKenney
2026-07-16  0:25 ` [PATCH 01/11] rcutorture: Abstract reader-segment dump into rcu_torture_dump_read_segs() Paul E. McKenney
2026-07-16  0:25 ` [PATCH 02/11] rcutorture: Check for immediate deboosting at reader end Paul E. McKenney
2026-07-16  0:25 ` [PATCH 03/11] rcutorture: Make srcu_read_delay() check for disabled interrupts Paul E. McKenney
2026-07-16  0:25 ` [PATCH 04/11] rcutorture: Test RCU readers from hardware interrupt handlers Paul E. McKenney
2026-07-16  0:25 ` [PATCH 05/11] rcutorture: Use cpumask_next_wrap() in rcu_torture_preempt() Paul E. McKenney
2026-07-16  0:25 ` [PATCH 06/11] rcutorture: Use task_state_to_char() for task-state reporting Paul E. McKenney
2026-07-16  0:25 ` [PATCH 07/11] rcutorture: Add nwriters module parameter Paul E. McKenney
2026-07-16  0:25 ` [PATCH 08/11] rcutorture: Add a stall_only " Paul E. McKenney
2026-07-16  0:25 ` [PATCH 09/11] rcutorture: Test RCU Tasks Trace GP implying RCU GP Paul E. McKenney
2026-07-16  0:25 ` Paul E. McKenney [this message]
2026-07-16  0:25 ` [PATCH 11/11] rcutorture: Use this_cpu_inc() for rcu_torture_count[] and rcu_torture_batch[] Paul E. McKenney

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=20260716002520.11895-10-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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

Powered by JetHome