Skip to content

Commit 48c21c0

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
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: "Paul E. McKenney" <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent 42a8a26 commit 48c21c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/rcu/rcuscale.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ struct rcu_scale_ops {
145145
void (*sync)(void);
146146
void (*exp_sync)(void);
147147
struct task_struct *(*rso_gp_kthread)(void);
148+
void (*stats)(void);
148149
const char *name;
149150
};
150151

@@ -226,6 +227,11 @@ static void srcu_scale_synchronize(void)
226227
synchronize_srcu(srcu_ctlp);
227228
}
228229

230+
static void srcu_scale_stats(void)
231+
{
232+
srcu_torture_stats_print(srcu_ctlp, scale_type, SCALE_FLAG);
233+
}
234+
229235
static void srcu_scale_synchronize_expedited(void)
230236
{
231237
synchronize_srcu_expedited(srcu_ctlp);
@@ -243,6 +249,7 @@ static struct rcu_scale_ops srcu_ops = {
243249
.gp_barrier = srcu_rcu_barrier,
244250
.sync = srcu_scale_synchronize,
245251
.exp_sync = srcu_scale_synchronize_expedited,
252+
.stats = srcu_scale_stats,
246253
.name = "srcu"
247254
};
248255

@@ -272,6 +279,7 @@ static struct rcu_scale_ops srcud_ops = {
272279
.gp_barrier = srcu_rcu_barrier,
273280
.sync = srcu_scale_synchronize,
274281
.exp_sync = srcu_scale_synchronize_expedited,
282+
.stats = srcu_scale_stats,
275283
.name = "srcud"
276284
};
277285

@@ -563,6 +571,8 @@ rcu_scale_writer(void *arg)
563571
pr_info("%s: Task %ld flags writer %d:\n", __func__, me, i);
564572
sched_show_task(writer_tasks[i]);
565573
}
574+
if (cur_ops->stats)
575+
cur_ops->stats();
566576
}
567577
}
568578
if (started && !alldone && i < MAX_MEAS - 1)

0 commit comments

Comments
 (0)