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 rcu 6/6] rcu/tasks: Add rcu_barrier_tasks*() start time to diagnostics
Date: Thu, 1 Aug 2024 17:34:26 -0700 [thread overview]
Message-ID: <20240802003426.4134196-6-paulmck@kernel.org> (raw)
In-Reply-To: <41c68c6b-2c55-4c2d-ab70-f2a5b38eb374@paulmck-laptop>
This commit adds the start time, in jiffies, of the most recently started
rcu_barrier_tasks*() operation to the diagnostic output used by rcuscale.
This information can be helpful in distinguishing a hung barrier operation
from a long series of barrier operations.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/rcu/tasks.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 37597f7c581ca..2f8d6c8e3c4ce 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -85,6 +85,7 @@ struct rcu_tasks_percpu {
* @barrier_q_count: Number of queues being waited on.
* @barrier_q_completion: Barrier wait/wakeup mechanism.
* @barrier_q_seq: Sequence number for barrier operations.
+ * @barrier_q_start: Most recent barrier start in jiffies.
* @name: This flavor's textual name.
* @kname: This flavor's kthread name.
*/
@@ -120,6 +121,7 @@ struct rcu_tasks {
atomic_t barrier_q_count;
struct completion barrier_q_completion;
unsigned long barrier_q_seq;
+ unsigned long barrier_q_start;
char *name;
char *kname;
};
@@ -428,6 +430,7 @@ static void __maybe_unused rcu_barrier_tasks_generic(struct rcu_tasks *rtp)
mutex_unlock(&rtp->barrier_q_mutex);
return;
}
+ rtp->barrier_q_start = jiffies;
rcu_seq_start(&rtp->barrier_q_seq);
init_completion(&rtp->barrier_q_completion);
atomic_set(&rtp->barrier_q_count, 2);
@@ -783,8 +786,9 @@ static void rcu_tasks_torture_stats_print_generic(struct rcu_tasks *rtp, char *t
pr_cont(".\n");
else
pr_cont(" (none).\n");
- pr_alert("\tBarrier seq %lu count %d holdout CPUs ",
- data_race(rtp->barrier_q_seq), atomic_read(&rtp->barrier_q_count));
+ pr_alert("\tBarrier seq %lu start %lu count %d holdout CPUs ",
+ data_race(rtp->barrier_q_seq), j - data_race(rtp->barrier_q_start),
+ atomic_read(&rtp->barrier_q_count));
if (cpumask_available(cm) && !cpumask_empty(cm))
pr_cont(" %*pbl.\n", cpumask_pr_args(cm));
else
--
2.40.1
prev parent reply other threads:[~2024-08-02 0:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 0:34 [PATCH rcu 0/6] Add RCU Tasks diagnostics and documentation Paul E. McKenney
2024-08-02 0:34 ` [PATCH rcu 1/6] rcu/tasks: Check processor-ID assumptions Paul E. McKenney
2024-08-14 12:16 ` Neeraj Upadhyay
2024-08-14 16:13 ` Paul E. McKenney
2024-08-02 0:34 ` [PATCH rcu 2/6] rcu/tasks: Update rtp->tasks_gp_seq comment Paul E. McKenney
2024-08-02 0:34 ` [PATCH rcu 3/6] rcu: Provide rcu_barrier_cb_is_done() to check rcu_barrier() CBs Paul E. McKenney
2024-08-02 0:34 ` [PATCH rcu 4/6] rcu/tasks: Mark callbacks not currently participating in barrier operation Paul E. McKenney
2024-08-02 0:34 ` [PATCH rcu 5/6] rcu/tasks: Add detailed grace-period and barrier diagnostics Paul E. McKenney
2024-08-02 0:34 ` Paul E. McKenney [this message]
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=20240802003426.4134196-6-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