From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
To: "Paul E . McKenney" <paulmck@kernel.org>
Cc: RCU <rcu@vger.kernel.org>,
Neeraj upadhyay <Neeraj.Upadhyay@amd.com>,
Boqun Feng <boqun.feng@gmail.com>,
Hillf Danton <hdanton@sina.com>,
Joel Fernandes <joel@joelfernandes.org>,
LKML <linux-kernel@vger.kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>,
Frederic Weisbecker <frederic@kernel.org>
Subject: [PATCH 27/48] rcu: Make hotplug operations track GP state, not flags
Date: Tue, 7 May 2024 11:35:09 +0200 [thread overview]
Message-ID: <20240507093530.3043-28-urezki@gmail.com> (raw)
In-Reply-To: <20240507093530.3043-1-urezki@gmail.com>
From: "Paul E. McKenney" <paulmck@kernel.org>
Currently, there are rcu_data structure fields named ->rcu_onl_gp_seq
and ->rcu_ofl_gp_seq that track the rcu_state.gp_flags field at the
time of the corresponding CPU's last online or offline operation,
respectively. However, this information is not particularly useful.
It would be better to instead track the grace period state kept
in rcu_state.gp_state. This would also be consistent with the
initialization in rcu_boot_init_percpu_data(), which is to RCU_GP_CLEANED
(an rcu_state.gp_state value), and also with the diagnostics in
rcu_implicit_dynticks_qs(), whose format is consistent with an integer,
not a bitmask.
This commit therefore makes this change and changes the names to
->rcu_onl_gp_flags and ->rcu_ofl_gp_flags, respectively.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
kernel/rcu/tree.c | 12 ++++++------
kernel/rcu/tree.h | 4 ++--
kernel/rcu/tree_plugin.h | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 7149b2d5cdd6..306f55b81d10 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -841,8 +841,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
__func__, rnp1->grplo, rnp1->grphi, rnp1->qsmask, rnp1->qsmaskinit, rnp1->qsmaskinitnext, rnp1->rcu_gp_init_mask);
pr_info("%s %d: %c online: %ld(%d) offline: %ld(%d)\n",
__func__, rdp->cpu, ".o"[rcu_rdp_cpu_online(rdp)],
- (long)rdp->rcu_onl_gp_seq, rdp->rcu_onl_gp_flags,
- (long)rdp->rcu_ofl_gp_seq, rdp->rcu_ofl_gp_flags);
+ (long)rdp->rcu_onl_gp_seq, rdp->rcu_onl_gp_state,
+ (long)rdp->rcu_ofl_gp_seq, rdp->rcu_ofl_gp_state);
return 1; /* Break things loose after complaining. */
}
@@ -4420,9 +4420,9 @@ rcu_boot_init_percpu_data(int cpu)
WARN_ON_ONCE(rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu)));
rdp->barrier_seq_snap = rcu_state.barrier_sequence;
rdp->rcu_ofl_gp_seq = rcu_state.gp_seq;
- rdp->rcu_ofl_gp_flags = RCU_GP_CLEANED;
+ rdp->rcu_ofl_gp_state = RCU_GP_CLEANED;
rdp->rcu_onl_gp_seq = rcu_state.gp_seq;
- rdp->rcu_onl_gp_flags = RCU_GP_CLEANED;
+ rdp->rcu_onl_gp_state = RCU_GP_CLEANED;
rdp->last_sched_clock = jiffies;
rdp->cpu = cpu;
rcu_boot_init_nocb_percpu_data(rdp);
@@ -4682,7 +4682,7 @@ void rcutree_report_cpu_starting(unsigned int cpu)
ASSERT_EXCLUSIVE_WRITER(rcu_state.ncpus);
rcu_gpnum_ovf(rnp, rdp); /* Offline-induced counter wrap? */
rdp->rcu_onl_gp_seq = READ_ONCE(rcu_state.gp_seq);
- rdp->rcu_onl_gp_flags = READ_ONCE(rcu_state.gp_flags);
+ rdp->rcu_onl_gp_state = READ_ONCE(rcu_state.gp_state);
/* An incoming CPU should never be blocking a grace period. */
if (WARN_ON_ONCE(rnp->qsmask & mask)) { /* RCU waiting on incoming CPU? */
@@ -4733,7 +4733,7 @@ void rcutree_report_cpu_dead(void)
arch_spin_lock(&rcu_state.ofl_lock);
raw_spin_lock_irqsave_rcu_node(rnp, flags); /* Enforce GP memory-order guarantee. */
rdp->rcu_ofl_gp_seq = READ_ONCE(rcu_state.gp_seq);
- rdp->rcu_ofl_gp_flags = READ_ONCE(rcu_state.gp_flags);
+ rdp->rcu_ofl_gp_state = READ_ONCE(rcu_state.gp_state);
if (rnp->qsmask & mask) { /* RCU waiting on outgoing CPU? */
/* Report quiescent state -before- changing ->qsmaskinitnext! */
rcu_disable_urgency_upon_qs(rdp);
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index df48160b3136..ff4d8b60554b 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -273,9 +273,9 @@ struct rcu_data {
bool rcu_iw_pending; /* Is ->rcu_iw pending? */
unsigned long rcu_iw_gp_seq; /* ->gp_seq associated with ->rcu_iw. */
unsigned long rcu_ofl_gp_seq; /* ->gp_seq at last offline. */
- short rcu_ofl_gp_flags; /* ->gp_flags at last offline. */
+ short rcu_ofl_gp_state; /* ->gp_state at last offline. */
unsigned long rcu_onl_gp_seq; /* ->gp_seq at last online. */
- short rcu_onl_gp_flags; /* ->gp_flags at last online. */
+ short rcu_onl_gp_state; /* ->gp_state at last online. */
unsigned long last_fqs_resched; /* Time of last rcu_resched(). */
unsigned long last_sched_clock; /* Jiffies of last rcu_sched_clock_irq(). */
struct rcu_snap_record snap_record; /* Snapshot of core stats at half of */
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 36a8b5dbf5b5..340bbefe5f65 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -805,8 +805,8 @@ dump_blkd_tasks(struct rcu_node *rnp, int ncheck)
rdp = per_cpu_ptr(&rcu_data, cpu);
pr_info("\t%d: %c online: %ld(%d) offline: %ld(%d)\n",
cpu, ".o"[rcu_rdp_cpu_online(rdp)],
- (long)rdp->rcu_onl_gp_seq, rdp->rcu_onl_gp_flags,
- (long)rdp->rcu_ofl_gp_seq, rdp->rcu_ofl_gp_flags);
+ (long)rdp->rcu_onl_gp_seq, rdp->rcu_onl_gp_state,
+ (long)rdp->rcu_ofl_gp_seq, rdp->rcu_ofl_gp_state);
}
}
--
2.39.2
next prev parent reply other threads:[~2024-05-07 9:36 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 9:34 [PATCH 00/48] RCU changes for v6.10 Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 01/48] scftorture: Increase memory provided to guest OS Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 02/48] rcutorture: Disable tracing to permit Tasks Rude RCU testing Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 03/48] rcu: Add lockdep checks and kernel-doc header to rcu_softirq_qs() Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 04/48] rcutorture: Enable RCU priority boosting for TREE09 Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 05/48] rcutorture: Dump # online CPUs on insufficient cb-flood laundering Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 06/48] rcutorture: Dump GP kthread state " Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 07/48] rcutorture: ASSERT_EXCLUSIVE_WRITER() for ->rtort_pipe_count updates Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 08/48] rcu-tasks: Make Tasks RCU wait idly for grace-period delays Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 09/48] doc: Remove references to arrayRCU.rst Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 10/48] MAINTAINERS: Update Neeraj's email address Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 11/48] bpf: Select new NEED_TASKS_RCU Kconfig option Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 12/48] arch: " Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 13/48] rcu: Add data structures for synchronize_rcu() Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 14/48] tracing: Select new NEED_TASKS_RCU Kconfig option Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 15/48] bpf: Choose RCU Tasks based on TASKS_RCU rather than PREEMPTION Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 16/48] ftrace: " Uladzislau Rezki (Sony)
2024-05-07 9:34 ` [PATCH 17/48] rcu: Update lockdep while in RCU read-side critical section Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 18/48] rcu: Make TINY_RCU depend on !PREEMPT_RCU rather than !PREEMPTION Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 19/48] srcu: Make Tiny SRCU explicitly disable preemption Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 20/48] rcu: Create NEED_TASKS_RCU to factor out enablement logic Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 21/48] rcu: Remove redundant BH disabling in TINY_RCU Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 22/48] rcu: Make Tiny RCU explicitly disable preemption Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 23/48] rcu: Remove redundant READ_ONCE() of rcu_state.gp_flags in tree.c Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 24/48] rcu: Bring diagnostic read of rcu_state.gp_flags into alignment Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 25/48] rcu: Mark writes to rcu_sync ->gp_count field Uladzislau Rezki (Sony)
2024-05-07 14:54 ` Oleg Nesterov
2024-05-07 17:44 ` Paul E. McKenney
2024-05-09 15:13 ` Oleg Nesterov
2024-05-10 3:59 ` Paul E. McKenney
2024-05-10 11:31 ` Oleg Nesterov
2024-05-10 14:00 ` Alan Huang
2024-05-10 14:04 ` Paul E. McKenney
2024-05-12 10:53 ` Oleg Nesterov
2024-05-12 14:57 ` Paul E. McKenney
2024-05-10 13:18 ` Oleg Nesterov
2024-05-10 13:50 ` Oleg Nesterov
2024-05-10 14:11 ` Paul E. McKenney
2024-05-12 10:41 ` Oleg Nesterov
2024-05-13 14:13 ` Marco Elver
2024-05-14 16:54 ` Paul E. McKenney
2024-05-10 13:58 ` Paul E. McKenney
2024-05-12 11:19 ` [PATCH] rcu/sync: don't read rcu_sync->gp_count lockless Oleg Nesterov
2024-05-12 15:10 ` Paul E. McKenney
2024-05-12 16:55 ` Oleg Nesterov
2024-05-12 17:11 ` Paul E. McKenney
2024-05-12 18:06 ` Oleg Nesterov
2024-05-07 9:35 ` [PATCH 26/48] rcu: Mark loads from rcu_state.n_online_cpus Uladzislau Rezki (Sony)
2024-05-07 9:35 ` Uladzislau Rezki (Sony) [this message]
2024-05-07 9:35 ` [PATCH 28/48] rcu: Inform KCSAN of one-byte cmpxchg() in rcu_trc_cmpxchg_need_qs() Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 29/48] rcu: Remove redundant CONFIG_PROVE_RCU #if condition Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 30/48] rcu-tasks: Replace exit_tasks_rcu_start() initialization with WARN_ON_ONCE() Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 31/48] rcu-tasks: Fix the comments for tasks_rcu_exit_srcu_stall_timer Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 32/48] rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 33/48] rcu: Mollify sparse with RCU guard Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 34/48] rcu: Fix buffer overflow in print_cpu_stall_info() Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 35/48] rcu: Reduce synchronize_rcu() latency Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 36/48] rcu: Add a trace event for synchronize_rcu_normal() Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 37/48] rcu: Support direct wake-up of synchronize_rcu() users Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 38/48] rcu: Allocate WQ with WQ_MEM_RECLAIM bit set Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 39/48] rcutorture: Remove extraneous rcu_torture_pipe_update_one() READ_ONCE() Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 40/48] rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 41/48] rcutorture: Re-use value stored to ->rtort_pipe_count instead of re-reading Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 42/48] rcutorture: Use the gp_kthread_dbg operation specified by cur_ops Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 43/48] rcutorture: Make rcutorture support print rcu-tasks gp state Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 44/48] rcutorture: Removing redundant function pointer initialization Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 45/48] rcutorture: Make stall-tasks directly exit when rcutorture tests end Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 46/48] rcutorture: Fix invalid context warning when enable srcu barrier testing Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 47/48] torture: Scale --do-kvfree test time Uladzislau Rezki (Sony)
2024-05-07 9:35 ` [PATCH 48/48] rcutorture: Use rcu_gp_slow_register/unregister() only for rcutype test Uladzislau Rezki (Sony)
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=20240507093530.3043-28-urezki@gmail.com \
--to=urezki@gmail.com \
--cc=Neeraj.Upadhyay@amd.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=hdanton@sina.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksiy.avramchenko@sony.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.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