Commit 48c21c02 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Neeraj Upadhyay

rcuscale: Dump grace-period statistics when rcu_scale_writer() stalls

This commit adds a .stats function pointer to the rcu_scale_ops structure,
and if this is non-NULL, it is invoked after stack traces are dumped in
response to a rcu_scale_writer() stall.
Signed-off-by: default avatar"Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: default avatarNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
parent 42a8a269
...@@ -145,6 +145,7 @@ struct rcu_scale_ops { ...@@ -145,6 +145,7 @@ struct rcu_scale_ops {
void (*sync)(void); void (*sync)(void);
void (*exp_sync)(void); void (*exp_sync)(void);
struct task_struct *(*rso_gp_kthread)(void); struct task_struct *(*rso_gp_kthread)(void);
void (*stats)(void);
const char *name; const char *name;
}; };
...@@ -226,6 +227,11 @@ static void srcu_scale_synchronize(void) ...@@ -226,6 +227,11 @@ static void srcu_scale_synchronize(void)
synchronize_srcu(srcu_ctlp); synchronize_srcu(srcu_ctlp);
} }
static void srcu_scale_stats(void)
{
srcu_torture_stats_print(srcu_ctlp, scale_type, SCALE_FLAG);
}
static void srcu_scale_synchronize_expedited(void) static void srcu_scale_synchronize_expedited(void)
{ {
synchronize_srcu_expedited(srcu_ctlp); synchronize_srcu_expedited(srcu_ctlp);
...@@ -243,6 +249,7 @@ static struct rcu_scale_ops srcu_ops = { ...@@ -243,6 +249,7 @@ static struct rcu_scale_ops srcu_ops = {
.gp_barrier = srcu_rcu_barrier, .gp_barrier = srcu_rcu_barrier,
.sync = srcu_scale_synchronize, .sync = srcu_scale_synchronize,
.exp_sync = srcu_scale_synchronize_expedited, .exp_sync = srcu_scale_synchronize_expedited,
.stats = srcu_scale_stats,
.name = "srcu" .name = "srcu"
}; };
...@@ -272,6 +279,7 @@ static struct rcu_scale_ops srcud_ops = { ...@@ -272,6 +279,7 @@ static struct rcu_scale_ops srcud_ops = {
.gp_barrier = srcu_rcu_barrier, .gp_barrier = srcu_rcu_barrier,
.sync = srcu_scale_synchronize, .sync = srcu_scale_synchronize,
.exp_sync = srcu_scale_synchronize_expedited, .exp_sync = srcu_scale_synchronize_expedited,
.stats = srcu_scale_stats,
.name = "srcud" .name = "srcud"
}; };
...@@ -563,6 +571,8 @@ rcu_scale_writer(void *arg) ...@@ -563,6 +571,8 @@ rcu_scale_writer(void *arg)
pr_info("%s: Task %ld flags writer %d:\n", __func__, me, i); pr_info("%s: Task %ld flags writer %d:\n", __func__, me, i);
sched_show_task(writer_tasks[i]); sched_show_task(writer_tasks[i]);
} }
if (cur_ops->stats)
cur_ops->stats();
} }
} }
if (started && !alldone && i < MAX_MEAS - 1) if (started && !alldone && i < MAX_MEAS - 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment