Skip to content

Commit 72611ab

Browse files
committed
rcu: Add more diagnostics to expedited stall warning messages.
This commit adds print statements that check the rcu_node structure to find which ->expmask bits and which ->exp_tasks structures are blocking the current expedited grace period. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent 73f36f9 commit 72611ab

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

kernel/rcu/tree.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
37453745
unsigned long jiffies_stall;
37463746
unsigned long jiffies_start;
37473747
unsigned long mask;
3748+
int ndetected;
37483749
struct rcu_node *rnp;
37493750
struct rcu_node *rnp_root = rcu_get_root(rsp);
37503751
int ret;
@@ -3767,14 +3768,16 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
37673768
}
37683769
pr_err("INFO: %s detected expedited stalls on CPUs/tasks: {",
37693770
rsp->name);
3771+
ndetected = 0;
37703772
rcu_for_each_leaf_node(rsp, rnp) {
3771-
(void)rcu_print_task_exp_stall(rnp);
3773+
ndetected = rcu_print_task_exp_stall(rnp);
37723774
mask = 1;
37733775
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++, mask <<= 1) {
37743776
struct rcu_data *rdp;
37753777

37763778
if (!(rnp->expmask & mask))
37773779
continue;
3780+
ndetected++;
37783781
rdp = per_cpu_ptr(rsp->rda, cpu);
37793782
pr_cont(" %d-%c%c%c", cpu,
37803783
"O."[cpu_online(cpu)],
@@ -3783,8 +3786,23 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
37833786
}
37843787
mask <<= 1;
37853788
}
3786-
pr_cont(" } %lu jiffies s: %lu\n",
3787-
jiffies - jiffies_start, rsp->expedited_sequence);
3789+
pr_cont(" } %lu jiffies s: %lu root: %#lx/%c\n",
3790+
jiffies - jiffies_start, rsp->expedited_sequence,
3791+
rnp_root->expmask, ".T"[!!rnp_root->exp_tasks]);
3792+
if (!ndetected) {
3793+
pr_err("blocking rcu_node structures:");
3794+
rcu_for_each_node_breadth_first(rsp, rnp) {
3795+
if (rnp == rnp_root)
3796+
continue; /* printed unconditionally */
3797+
if (sync_rcu_preempt_exp_done(rnp))
3798+
continue;
3799+
pr_cont(" l=%u:%d-%d:%#lx/%c",
3800+
rnp->level, rnp->grplo, rnp->grphi,
3801+
rnp->expmask,
3802+
".T"[!!rnp->exp_tasks]);
3803+
}
3804+
pr_cont("\n");
3805+
}
37883806
rcu_for_each_leaf_node(rsp, rnp) {
37893807
mask = 1;
37903808
for (cpu = rnp->grplo; cpu <= rnp->grphi; cpu++, mask <<= 1) {

0 commit comments

Comments
 (0)