linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valentin Schneider <vschneid@redhat.com>
To: rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Frederic Weisbecker <frederic@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang1211@gmail.com>
Subject: [PATCH v2 16/27] rcu: Rename rcu_dynticks_snap() into rcu_watching_snap()
Date: Tue, 30 Apr 2024 11:17:20 +0200	[thread overview]
Message-ID: <20240430091740.1826862-17-vschneid@redhat.com> (raw)
In-Reply-To: <20240430091740.1826862-1-vschneid@redhat.com>

The context_tracking.state RCU_DYNTICKS subvariable has been renamed to
RCU_WATCHING, reflect that change in the related helpers.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst |  2 +-
 kernel/rcu/tree.c                                | 16 ++++++++--------
 kernel/rcu/tree_exp.h                            |  2 +-
 kernel/rcu/tree_stall.h                          |  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst
index 5750f125361b0..e8ef12ca1e9da 100644
--- a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst
+++ b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst
@@ -149,7 +149,7 @@ This case is handled by calls to the strongly ordered
 ``atomic_add_return()`` read-modify-write atomic operation that
 is invoked within ``rcu_dynticks_eqs_enter()`` at idle-entry
 time and within ``rcu_dynticks_eqs_exit()`` at idle-exit time.
-The grace-period kthread invokes ``rcu_dynticks_snap()`` and
+The grace-period kthread invokes ``rcu_watching_snap()`` and
 ``rcu_dynticks_in_eqs_since()`` (both of which invoke
 an ``atomic_add_return()`` of zero) to detect idle CPUs.
 
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index fe2beb7d2e82d..857c2565efeac 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -297,17 +297,17 @@ static void rcu_watching_eqs_online(void)
 }
 
 /*
- * Snapshot the ->dynticks counter with full ordering so as to allow
+ * Snapshot the RCU_WATCHING counter with full ordering so as to allow
  * stable comparison of this counter with past and future snapshots.
  */
-static int rcu_dynticks_snap(int cpu)
+static int rcu_watching_snap(int cpu)
 {
 	smp_mb();  // Fundamental RCU ordering guarantee.
 	return ct_rcu_watching_cpu_acquire(cpu);
 }
 
 /*
- * Return true if the snapshot returned from rcu_dynticks_snap()
+ * Return true if the snapshot returned from rcu_watching_snap()
  * indicates that RCU is in an extended quiescent state.
  */
 static bool rcu_dynticks_in_eqs(int snap)
@@ -318,11 +318,11 @@ static bool rcu_dynticks_in_eqs(int snap)
 /*
  * Return true if the CPU corresponding to the specified rcu_data
  * structure has spent some time in an extended quiescent state since
- * rcu_dynticks_snap() returned the specified snapshot.
+ * rcu_watching_snap() returned the specified snapshot.
  */
 static bool rcu_dynticks_in_eqs_since(struct rcu_data *rdp, int snap)
 {
-	return snap != rcu_dynticks_snap(rdp->cpu);
+	return snap != rcu_watching_snap(rdp->cpu);
 }
 
 /*
@@ -770,7 +770,7 @@ static void rcu_gpnum_ovf(struct rcu_node *rnp, struct rcu_data *rdp)
  */
 static int dyntick_save_progress_counter(struct rcu_data *rdp)
 {
-	rdp->dynticks_snap = rcu_dynticks_snap(rdp->cpu);
+	rdp->dynticks_snap = rcu_watching_snap(rdp->cpu);
 	if (rcu_dynticks_in_eqs(rdp->dynticks_snap)) {
 		trace_rcu_fqs(rcu_state.name, rdp->gp_seq, rdp->cpu, TPS("dti"));
 		rcu_gpnum_ovf(rdp->mynode, rdp);
@@ -2185,7 +2185,7 @@ static noinline void rcu_gp_cleanup(void)
 
 		// We get here either if there is no need for an
 		// additional grace period or if rcu_accelerate_cbs() has
-		// already set the RCU_GP_FLAG_INIT bit in ->gp_flags. 
+		// already set the RCU_GP_FLAG_INIT bit in ->gp_flags.
 		// So all we need to do is to clear all of the other
 		// ->gp_flags bits.
 
@@ -4798,7 +4798,7 @@ rcu_boot_init_percpu_data(int cpu)
 	rdp->grpmask = leaf_node_cpu_bit(rdp->mynode, cpu);
 	INIT_WORK(&rdp->strict_work, strict_work_handler);
 	WARN_ON_ONCE(ct->nesting != 1);
-	WARN_ON_ONCE(rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu)));
+	WARN_ON_ONCE(rcu_dynticks_in_eqs(rcu_watching_snap(cpu)));
 	rdp->barrier_seq_snap = rcu_state.barrier_sequence;
 	rdp->rcu_ofl_gp_seq = rcu_state.gp_seq;
 	rdp->rcu_ofl_gp_state = RCU_GP_CLEANED;
diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 8a1d9c8bd9f74..50ec57304c1b7 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -357,7 +357,7 @@ static void __sync_rcu_exp_select_node_cpus(struct rcu_exp_work *rewp)
 		    !(rnp->qsmaskinitnext & mask)) {
 			mask_ofl_test |= mask;
 		} else {
-			snap = rcu_dynticks_snap(cpu);
+			snap = rcu_watching_snap(cpu);
 			if (rcu_dynticks_in_eqs(snap))
 				mask_ofl_test |= mask;
 			else
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index 6cb346952e3e4..4fa23f9fc207f 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -501,7 +501,7 @@ static void print_cpu_stall_info(int cpu)
 	}
 	delta = rcu_seq_ctr(rdp->mynode->gp_seq - rdp->rcu_iw_gp_seq);
 	falsepositive = rcu_is_gp_kthread_starving(NULL) &&
-			rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu));
+			rcu_dynticks_in_eqs(rcu_watching_snap(cpu));
 	rcuc_starved = rcu_is_rcuc_kthread_starving(rdp, &j);
 	if (rcuc_starved)
 		// Print signed value, as negative values indicate a probable bug.
@@ -515,7 +515,7 @@ static void print_cpu_stall_info(int cpu)
 			rdp->rcu_iw_pending ? (int)min(delta, 9UL) + '0' :
 				"!."[!delta],
 	       ticks_value, ticks_title,
-	       rcu_dynticks_snap(cpu) & 0xffff,
+	       rcu_watching_snap(cpu) & 0xffff,
 	       ct_nesting_cpu(cpu), ct_nmi_nesting_cpu(cpu),
 	       rdp->softirq_snap, kstat_softirqs_cpu(RCU_SOFTIRQ, cpu),
 	       data_race(rcu_state.n_force_qs) - rcu_state.n_force_qs_gpstart,
-- 
2.43.0


  parent reply	other threads:[~2024-04-30  9:18 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30  9:17 [PATCH v2 00/27] context_tracking, rcu: Spring cleaning renaming Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 01/27] treewide: context_tracking: Rename CONTEXT_* into CT_STATE_* Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 02/27] context_tracking, rcu: Rename RCU_DYNTICKS_IDX into CT_RCU_WATCHING Valentin Schneider
2024-05-06 10:39   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 03/27] context_tracking, rcu: Rename ct_dynticks() into ct_rcu_watching() Valentin Schneider
2024-05-06 10:41   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 04/27] context_tracking, rcu: Rename ct_dynticks_cpu() into ct_rcu_watching_cpu() Valentin Schneider
2024-05-06 10:43   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 05/27] context_tracking, rcu: Rename ct_dynticks_cpu_acquire() into ct_rcu_watching_cpu_acquire() Valentin Schneider
2024-05-06 10:45   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 06/27] context_tracking, rcu: Rename struct context_tracking .dynticks_nesting into .nesting Valentin Schneider
2024-05-06 10:48   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 07/27] context_tracking, rcu: Rename ct_dynticks_nesting() into ct_nesting() Valentin Schneider
2024-05-06 11:01   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 08/27] context_tracking, rcu: Rename ct_dynticks_nesting_cpu() into ct_nesting_cpu() Valentin Schneider
2024-05-06 20:09   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 09/27] context_tracking, rcu: Rename struct context_tracking .dynticks_nmi_nesting into .nmi_nesting Valentin Schneider
2024-05-06 20:19   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 10/27] context_tracking, rcu: Rename ct_dynticks_nmi_nesting() into ct_nmi_nesting() Valentin Schneider
2024-05-06 20:50   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 11/27] context_tracking, rcu: Rename ct_dynticks_nmi_nesting_cpu() into ct_nmi_nesting_cpu() Valentin Schneider
2024-05-06 21:03   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 12/27] context_tracking, rcu: Rename DYNTICK_IRQ_NONIDLE into CT_NESTING_IRQ_NONIDLE Valentin Schneider
2024-05-06 21:06   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 13/27] context_tracking, rcu: Rename rcu_dynticks_task*() into rcu_task*() Valentin Schneider
2024-05-06 21:15   ` Frederic Weisbecker
2024-05-08 14:39   ` Frederic Weisbecker
2024-05-13 18:39     ` Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 14/27] context_tracking, rcu: Rename rcu_dynticks_curr_cpu_in_eqs() into rcu_watching_curr_cpu() Valentin Schneider
2024-05-06 22:00   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 15/27] rcu: Rename rcu_dynticks_eqs_online() into rcu_watching_eqs_online() Valentin Schneider
2024-05-06 22:18   ` Frederic Weisbecker
2024-05-07  8:59     ` Valentin Schneider
2024-04-30  9:17 ` Valentin Schneider [this message]
2024-05-07 13:11   ` [PATCH v2 16/27] rcu: Rename rcu_dynticks_snap() into rcu_watching_snap() Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 17/27] rcu: Rename rcu_dynticks_in_eqs() into rcu_watching_in_eqs() Valentin Schneider
2024-05-07 13:32   ` Frederic Weisbecker
2024-05-07 15:48     ` Valentin Schneider
2024-05-08 10:46       ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 18/27] rcu: Rename rcu_dynticks_in_eqs_since() into rcu_watching_changed_since() Valentin Schneider
2024-05-07 13:48   ` Frederic Weisbecker
2024-05-07 17:14     ` Paul E. McKenney
2024-05-08 10:59       ` Frederic Weisbecker
2024-05-13 18:40         ` Valentin Schneider
2024-05-14 10:42           ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 19/27] rcu: Rename rcu_dynticks_zero_in_eqs() into rcu_watching_zero_in_eqs() Valentin Schneider
2024-05-08 12:43   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 20/27] rcu: Rename struct rcu_data .dynticks_snap into .watching_snap Valentin Schneider
2024-05-08 12:55   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 21/27] rcu: Rename struct rcu_data .exp_dynticks_snap into .exp_watching_snap Valentin Schneider
2024-05-08 13:06   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 22/27] rcu: Rename dyntick_save_progress_counter() into eqs_save_progress_counter() Valentin Schneider
2024-05-08 13:21   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 23/27] rcu: Rename rcu_implicit_dynticks_qs() into rcu_implicit_eqs() Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 24/27] rcu: Rename rcu_momentary_dyntick_idle() into rcu_momentary_eqs() Valentin Schneider
2024-05-08 13:30   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 25/27] context_tracking, rcu: Rename stray ->dynticks comments Valentin Schneider
2024-05-08 13:39   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 26/27] rcu: Update stray documentation references to rcu_dynticks_eqs_{enter, exit}() Valentin Schneider
2024-05-08 14:55   ` Frederic Weisbecker
2024-05-13 18:40     ` Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 27/27] context_tracking, rcu: Rename rcu_dyntick trace event into rcu_watching Valentin Schneider
2024-05-08 13:59   ` Frederic Weisbecker
2024-05-13 18:40     ` Valentin Schneider
2024-05-14 12:09       ` Frederic Weisbecker

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=20240430091740.1826862-17-vschneid@redhat.com \
    --to=vschneid@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=quic_neeraju@quicinc.com \
    --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;
as well as URLs for NNTP newsgroup(s).