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 v3 06/25] context_tracking, rcu: Rename struct context_tracking .dynticks_nesting into .nesting
Date: Wed, 24 Jul 2024 16:43:06 +0200 [thread overview]
Message-ID: <20240724144325.3307148-7-vschneid@redhat.com> (raw)
In-Reply-To: <20240724144325.3307148-1-vschneid@redhat.com>
The context_tracking.state RCU_DYNTICKS subvariable has been renamed to
RCU_WATCHING, reflect that change in the related helpers.
Suggested-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
---
.../RCU/Design/Data-Structures/Data-Structures.rst | 10 +++++-----
include/linux/context_tracking_state.h | 6 +++---
include/trace/events/rcu.h | 2 +-
kernel/context_tracking.c | 10 +++++-----
kernel/rcu/tree.c | 8 ++++----
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/Documentation/RCU/Design/Data-Structures/Data-Structures.rst b/Documentation/RCU/Design/Data-Structures/Data-Structures.rst
index b34990c7c3778..57ffc33d3cce2 100644
--- a/Documentation/RCU/Design/Data-Structures/Data-Structures.rst
+++ b/Documentation/RCU/Design/Data-Structures/Data-Structures.rst
@@ -935,7 +935,7 @@ This portion of the rcu_data structure is declared as follows:
::
- 1 long dynticks_nesting;
+ 1 long nesting;
2 long dynticks_nmi_nesting;
3 atomic_t dynticks;
4 bool rcu_need_heavy_qs;
@@ -945,7 +945,7 @@ These fields in the rcu_data structure maintain the per-CPU dyntick-idle
state for the corresponding CPU. The fields may be accessed only from
the corresponding CPU (and from tracing) unless otherwise stated.
-The ``->dynticks_nesting`` field counts the nesting depth of process
+The ``->nesting`` field counts the nesting depth of process
execution, so that in normal circumstances this counter has value zero
or one. NMIs, irqs, and tracers are counted by the
``->dynticks_nmi_nesting`` field. Because NMIs cannot be masked, changes
@@ -960,9 +960,9 @@ process-level transitions.
However, it turns out that when running in non-idle kernel context, the
Linux kernel is fully capable of entering interrupt handlers that never
exit and perhaps also vice versa. Therefore, whenever the
-``->dynticks_nesting`` field is incremented up from zero, the
+``->nesting`` field is incremented up from zero, the
``->dynticks_nmi_nesting`` field is set to a large positive number, and
-whenever the ``->dynticks_nesting`` field is decremented down to zero,
+whenever the ``->nesting`` field is decremented down to zero,
the ``->dynticks_nmi_nesting`` field is set to zero. Assuming that
the number of misnested interrupts is not sufficient to overflow the
counter, this approach corrects the ``->dynticks_nmi_nesting`` field
@@ -992,7 +992,7 @@ code.
+-----------------------------------------------------------------------+
| **Quick Quiz**: |
+-----------------------------------------------------------------------+
-| Why not simply combine the ``->dynticks_nesting`` and |
+| Why not simply combine the ``->nesting`` and |
| ``->dynticks_nmi_nesting`` counters into a single counter that just |
| counts the number of reasons that the corresponding CPU is non-idle? |
+-----------------------------------------------------------------------+
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index ad6570ffeff3c..65290e7677e6c 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -39,7 +39,7 @@ struct context_tracking {
atomic_t state;
#endif
#ifdef CONFIG_CONTEXT_TRACKING_IDLE
- long dynticks_nesting; /* Track process nesting level. */
+ long nesting; /* Track process nesting level. */
long dynticks_nmi_nesting; /* Track irq/NMI nesting level. */
#endif
};
@@ -77,14 +77,14 @@ static __always_inline int ct_rcu_watching_cpu_acquire(int cpu)
static __always_inline long ct_dynticks_nesting(void)
{
- return __this_cpu_read(context_tracking.dynticks_nesting);
+ return __this_cpu_read(context_tracking.nesting);
}
static __always_inline long ct_dynticks_nesting_cpu(int cpu)
{
struct context_tracking *ct = per_cpu_ptr(&context_tracking, cpu);
- return ct->dynticks_nesting;
+ return ct->nesting;
}
static __always_inline long ct_dynticks_nmi_nesting(void)
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 31b3e0d3e65f7..4066b6d51e46a 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -469,7 +469,7 @@ TRACE_EVENT(rcu_stall_warning,
* polarity: "Start", "End", "StillNonIdle" for entering, exiting or still not
* being in dyntick-idle mode.
* context: "USER" or "IDLE" or "IRQ".
- * NMIs nested in IRQs are inferred with dynticks_nesting > 1 in IRQ context.
+ * NMIs nested in IRQs are inferred with nesting > 1 in IRQ context.
*
* These events also take a pair of numbers, which indicate the nesting
* depth before and after the event of interest, and a third number that is
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
index 868ae0bcd4bed..5cfdfc03b4018 100644
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -28,7 +28,7 @@
DEFINE_PER_CPU(struct context_tracking, context_tracking) = {
#ifdef CONFIG_CONTEXT_TRACKING_IDLE
- .dynticks_nesting = 1,
+ .nesting = 1,
.dynticks_nmi_nesting = DYNTICK_IRQ_NONIDLE,
#endif
.state = ATOMIC_INIT(CT_RCU_WATCHING),
@@ -131,7 +131,7 @@ static void noinstr ct_kernel_exit(bool user, int offset)
ct_dynticks_nesting() == 0);
if (ct_dynticks_nesting() != 1) {
// RCU will still be watching, so just do accounting and leave.
- ct->dynticks_nesting--;
+ ct->nesting--;
return;
}
@@ -145,7 +145,7 @@ static void noinstr ct_kernel_exit(bool user, int offset)
instrument_atomic_write(&ct->state, sizeof(ct->state));
instrumentation_end();
- WRITE_ONCE(ct->dynticks_nesting, 0); /* Avoid irq-access tearing. */
+ WRITE_ONCE(ct->nesting, 0); /* Avoid irq-access tearing. */
// RCU is watching here ...
ct_kernel_exit_state(offset);
// ... but is no longer watching here.
@@ -170,7 +170,7 @@ static void noinstr ct_kernel_enter(bool user, int offset)
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && oldval < 0);
if (oldval) {
// RCU was already watching, so just do accounting and leave.
- ct->dynticks_nesting++;
+ ct->nesting++;
return;
}
rcu_dynticks_task_exit();
@@ -184,7 +184,7 @@ static void noinstr ct_kernel_enter(bool user, int offset)
trace_rcu_dyntick(TPS("End"), ct_dynticks_nesting(), 1, ct_rcu_watching());
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
- WRITE_ONCE(ct->dynticks_nesting, 1);
+ WRITE_ONCE(ct->nesting, 1);
WARN_ON_ONCE(ct_dynticks_nmi_nesting());
WRITE_ONCE(ct->dynticks_nmi_nesting, DYNTICK_IRQ_NONIDLE);
instrumentation_end();
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 273d223bd8efc..16007911c7890 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -381,7 +381,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
/* Check for counter underflows */
RCU_LOCKDEP_WARN(ct_dynticks_nesting() < 0,
- "RCU dynticks_nesting counter underflow!");
+ "RCU nesting counter underflow!");
RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() <= 0,
"RCU dynticks_nmi_nesting counter underflow/zero!");
@@ -589,7 +589,7 @@ void rcu_irq_exit_check_preempt(void)
lockdep_assert_irqs_disabled();
RCU_LOCKDEP_WARN(ct_dynticks_nesting() <= 0,
- "RCU dynticks_nesting counter underflow/zero!");
+ "RCU nesting counter underflow/zero!");
RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() !=
DYNTICK_IRQ_NONIDLE,
"Bad RCU dynticks_nmi_nesting counter\n");
@@ -4792,7 +4792,7 @@ rcu_boot_init_percpu_data(int cpu)
/* Set up local state, ensuring consistent view of global state. */
rdp->grpmask = leaf_node_cpu_bit(rdp->mynode, cpu);
INIT_WORK(&rdp->strict_work, strict_work_handler);
- WARN_ON_ONCE(ct->dynticks_nesting != 1);
+ WARN_ON_ONCE(ct->nesting != 1);
WARN_ON_ONCE(rcu_dynticks_in_eqs(ct_rcu_watching_cpu(cpu)));
rdp->barrier_seq_snap = rcu_state.barrier_sequence;
rdp->rcu_ofl_gp_seq = rcu_state.gp_seq;
@@ -4886,7 +4886,7 @@ int rcutree_prepare_cpu(unsigned int cpu)
rdp->qlen_last_fqs_check = 0;
rdp->n_force_qs_snap = READ_ONCE(rcu_state.n_force_qs);
rdp->blimit = blimit;
- ct->dynticks_nesting = 1; /* CPU not up, no tearing. */
+ ct->nesting = 1; /* CPU not up, no tearing. */
raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
/*
--
2.43.0
next prev parent reply other threads:[~2024-07-24 14:45 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 14:43 [PATCH v3 00/25] context_tracking, rcu: Spring cleaning of dynticks references Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 01/25] treewide: context_tracking: Rename CONTEXT_* into CT_STATE_* Valentin Schneider
2024-07-26 17:41 ` Thomas Gleixner
2024-07-24 14:43 ` [PATCH v3 02/25] context_tracking, rcu: Rename RCU_DYNTICKS_IDX into CT_RCU_WATCHING Valentin Schneider
2024-07-26 17:43 ` Thomas Gleixner
2024-07-24 14:43 ` [PATCH v3 03/25] context_tracking, rcu: Rename ct_dynticks() into ct_rcu_watching() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 04/25] context_tracking, rcu: Rename ct_dynticks_cpu() into ct_rcu_watching_cpu() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 05/25] context_tracking, rcu: Rename ct_dynticks_cpu_acquire() into ct_rcu_watching_cpu_acquire() Valentin Schneider
2024-07-24 20:20 ` Frederic Weisbecker
2024-07-24 14:43 ` Valentin Schneider [this message]
2024-07-24 14:43 ` [PATCH v3 07/25] context_tracking, rcu: Rename ct_dynticks_nesting() into ct_nesting() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 08/25] context_tracking, rcu: Rename ct_dynticks_nesting_cpu() into ct_nesting_cpu() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 09/25] context_tracking, rcu: Rename struct context_tracking .dynticks_nmi_nesting into .nmi_nesting Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 10/25] context_tracking, rcu: Rename ct_dynticks_nmi_nesting() into ct_nmi_nesting() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 11/25] context_tracking, rcu: Rename ct_dynticks_nmi_nesting_cpu() into ct_nmi_nesting_cpu() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 12/25] context_tracking, rcu: Rename DYNTICK_IRQ_NONIDLE into CT_NESTING_IRQ_NONIDLE Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 13/25] context_tracking, rcu: Rename rcu_dynticks_task*() into rcu_task*() Valentin Schneider
2024-07-25 14:32 ` RCU-Task[-Trace] VS EQS (was Re: [PATCH v3 13/25] context_tracking, rcu: Rename rcu_dynticks_task*() into rcu_task*()) Frederic Weisbecker
2024-07-30 14:23 ` Paul E. McKenney
2024-07-30 22:17 ` Frederic Weisbecker
2024-07-30 22:39 ` Paul E. McKenney
2024-07-31 12:28 ` Frederic Weisbecker
2024-08-03 4:32 ` Paul E. McKenney
2024-08-05 9:01 ` Peter Zijlstra
2024-08-05 12:18 ` Frederic Weisbecker
2024-08-05 13:26 ` Frederic Weisbecker
2024-08-05 17:04 ` Paul E. McKenney
2024-07-31 16:07 ` [PATCH v3 13/25] context_tracking, rcu: Rename rcu_dynticks_task*() into rcu_task*() Frederic Weisbecker
2024-08-14 12:06 ` Neeraj Upadhyay
2024-08-15 14:14 ` Frederic Weisbecker
2024-08-16 10:19 ` Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 14/25] context_tracking, rcu: Rename rcu_dynticks_curr_cpu_in_eqs() into rcu_watching_curr_cpu() Valentin Schneider
2024-07-25 12:10 ` Frederic Weisbecker
2024-07-25 14:46 ` Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 15/25] rcu: Rename rcu_dynticks_eqs_online() into rcu_watching_online() Valentin Schneider
2024-07-25 12:12 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 16/25] rcu: Rename rcu_dynticks_in_eqs() into rcu_watching_snap_in_eqs() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 17/25] rcu: Rename rcu_dynticks_in_eqs_since() into rcu_watching_snap_stopped_since() Valentin Schneider
2024-07-25 12:18 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 18/25] rcu: Rename rcu_dynticks_zero_in_eqs() into rcu_watching_zero_in_eqs() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 19/25] rcu: Rename struct rcu_data .dynticks_snap into .watching_snap Valentin Schneider
2024-07-25 12:21 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 20/25] rcu: Rename struct rcu_data .exp_dynticks_snap into .exp_watching_snap Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 21/25] rcu: Rename dyntick_save_progress_counter() into rcu_watching_snap_save() Valentin Schneider
2024-07-25 12:24 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 22/25] rcu: Rename rcu_implicit_dynticks_qs() into rcu_implicit_eqs() Valentin Schneider
2024-07-25 12:27 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 23/25] rcu: Rename rcu_momentary_dyntick_idle() into rcu_momentary_eqs() Valentin Schneider
2024-07-24 14:43 ` [PATCH v3 24/25] rcu: Update stray documentation references to rcu_dynticks_eqs_{enter, exit}() Valentin Schneider
2024-07-25 12:32 ` Frederic Weisbecker
2024-07-24 14:43 ` [PATCH v3 25/25] context_tracking, rcu: Rename rcu_dyntick trace event into rcu_watching Valentin Schneider
2024-07-25 12:39 ` Frederic Weisbecker
2024-07-25 14:47 ` Valentin Schneider
2024-07-25 15:22 ` [PATCH v3 00/25] context_tracking, rcu: Spring cleaning of dynticks references Neeraj Upadhyay
2024-07-25 16:07 ` Valentin Schneider
2024-07-25 16:44 ` Paul E. McKenney
2024-07-26 14:43 ` Valentin Schneider
2024-07-29 2:42 ` Neeraj Upadhyay
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=20240724144325.3307148-7-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
all inboxes | Powered by JetHome®