Skip to content

Commit 69381f3

Browse files
paulmckrcufbq
authored andcommitted
rcu/nocb: Print segment lengths in show_rcu_nocb_gp_state()
Analysis of an rcutorture callback-based forward-progress test failure was hampered by the lack of ->cblist segment lengths. This commit therefore adds this information, so that what would have been ".W85620.N." (there are some callbacks waiting for grace period sequence number 85620 and some number more that have not yet been assigned to a grace period) now prints as ".W2(85620).N6." (there are 2 callbacks waiting for grace period 85620 and 6 not yet assigned to a grace period). Note that "D" (done), "N" (next and not yet assigned to a grace period, and "B" (bypass, also not yet assigned to a grace period) have just the number of callbacks without the parenthesized grace-period sequence number. In contrast, "W" (waiting for the current grace period) and "R" (ready to wait for the next grace period to start) both have parenthesized grace-period sequence numbers. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 23c22d9 commit 69381f3

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

kernel/rcu/tree_nocb.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,11 @@ static void show_rcu_nocb_gp_state(struct rcu_data *rdp)
15571557
/* Dump out nocb kthread state for the specified rcu_data structure. */
15581558
static void show_rcu_nocb_state(struct rcu_data *rdp)
15591559
{
1560-
char bufw[20];
1561-
char bufr[20];
1560+
char bufd[22];
1561+
char bufw[45];
1562+
char bufr[45];
1563+
char bufn[22];
1564+
char bufb[22];
15621565
struct rcu_data *nocb_next_rdp;
15631566
struct rcu_segcblist *rsclp = &rdp->cblist;
15641567
bool waslocked;
@@ -1572,9 +1575,13 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
15721575
typeof(*rdp),
15731576
nocb_entry_rdp);
15741577

1575-
sprintf(bufw, "%ld", rsclp->gp_seq[RCU_WAIT_TAIL]);
1576-
sprintf(bufr, "%ld", rsclp->gp_seq[RCU_NEXT_READY_TAIL]);
1577-
pr_info(" CB %d^%d->%d %c%c%c%c%c F%ld L%ld C%d %c%c%s%c%s%c%c q%ld %c CPU %d%s\n",
1578+
sprintf(bufd, "%ld", rsclp->seglen[RCU_DONE_TAIL]);
1579+
sprintf(bufw, "%ld(%ld)", rsclp->seglen[RCU_WAIT_TAIL], rsclp->gp_seq[RCU_WAIT_TAIL]);
1580+
sprintf(bufr, "%ld(%ld)", rsclp->seglen[RCU_NEXT_READY_TAIL],
1581+
rsclp->gp_seq[RCU_NEXT_READY_TAIL]);
1582+
sprintf(bufn, "%ld", rsclp->seglen[RCU_NEXT_TAIL]);
1583+
sprintf(bufb, "%ld", rcu_cblist_n_cbs(&rdp->nocb_bypass));
1584+
pr_info(" CB %d^%d->%d %c%c%c%c%c F%ld L%ld C%d %c%s%c%s%c%s%c%s%c%s q%ld %c CPU %d%s\n",
15781585
rdp->cpu, rdp->nocb_gp_rdp->cpu,
15791586
nocb_next_rdp ? nocb_next_rdp->cpu : -1,
15801587
"kK"[!!rdp->nocb_cb_kthread],
@@ -1586,12 +1593,15 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
15861593
jiffies - rdp->nocb_nobypass_last,
15871594
rdp->nocb_nobypass_count,
15881595
".D"[rcu_segcblist_ready_cbs(rsclp)],
1596+
rcu_segcblist_segempty(rsclp, RCU_DONE_TAIL) ? "" : bufd,
15891597
".W"[!rcu_segcblist_segempty(rsclp, RCU_WAIT_TAIL)],
15901598
rcu_segcblist_segempty(rsclp, RCU_WAIT_TAIL) ? "" : bufw,
15911599
".R"[!rcu_segcblist_segempty(rsclp, RCU_NEXT_READY_TAIL)],
15921600
rcu_segcblist_segempty(rsclp, RCU_NEXT_READY_TAIL) ? "" : bufr,
15931601
".N"[!rcu_segcblist_segempty(rsclp, RCU_NEXT_TAIL)],
1602+
rcu_segcblist_segempty(rsclp, RCU_NEXT_TAIL) ? "" : bufn,
15941603
".B"[!!rcu_cblist_n_cbs(&rdp->nocb_bypass)],
1604+
!rcu_cblist_n_cbs(&rdp->nocb_bypass) ? "" : bufb,
15951605
rcu_segcblist_n_cbs(&rdp->cblist),
15961606
rdp->nocb_cb_kthread ? task_state_to_char(rdp->nocb_cb_kthread) : '.',
15971607
rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_cb_kthread) : -1,

0 commit comments

Comments
 (0)