Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Paul E. McKenney and committed by
Boqun Feng
69381f38 23c22d91

+15 -5
+15 -5
kernel/rcu/tree_nocb.h
··· 1557 1557 /* Dump out nocb kthread state for the specified rcu_data structure. */ 1558 1558 static void show_rcu_nocb_state(struct rcu_data *rdp) 1559 1559 { 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]; 1562 1565 struct rcu_data *nocb_next_rdp; 1563 1566 struct rcu_segcblist *rsclp = &rdp->cblist; 1564 1567 bool waslocked; ··· 1575 1572 typeof(*rdp), 1576 1573 nocb_entry_rdp); 1577 1574 1578 - sprintf(bufw, "%ld", rsclp->gp_seq[RCU_WAIT_TAIL]); 1579 - sprintf(bufr, "%ld", rsclp->gp_seq[RCU_NEXT_READY_TAIL]); 1580 - 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", 1575 + sprintf(bufd, "%ld", rsclp->seglen[RCU_DONE_TAIL]); 1576 + sprintf(bufw, "%ld(%ld)", rsclp->seglen[RCU_WAIT_TAIL], rsclp->gp_seq[RCU_WAIT_TAIL]); 1577 + sprintf(bufr, "%ld(%ld)", rsclp->seglen[RCU_NEXT_READY_TAIL], 1578 + rsclp->gp_seq[RCU_NEXT_READY_TAIL]); 1579 + sprintf(bufn, "%ld", rsclp->seglen[RCU_NEXT_TAIL]); 1580 + sprintf(bufb, "%ld", rcu_cblist_n_cbs(&rdp->nocb_bypass)); 1581 + 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", 1581 1582 rdp->cpu, rdp->nocb_gp_rdp->cpu, 1582 1583 nocb_next_rdp ? nocb_next_rdp->cpu : -1, 1583 1584 "kK"[!!rdp->nocb_cb_kthread], ··· 1593 1586 jiffies - rdp->nocb_nobypass_last, 1594 1587 rdp->nocb_nobypass_count, 1595 1588 ".D"[rcu_segcblist_ready_cbs(rsclp)], 1589 + rcu_segcblist_segempty(rsclp, RCU_DONE_TAIL) ? "" : bufd, 1596 1590 ".W"[!rcu_segcblist_segempty(rsclp, RCU_WAIT_TAIL)], 1597 1591 rcu_segcblist_segempty(rsclp, RCU_WAIT_TAIL) ? "" : bufw, 1598 1592 ".R"[!rcu_segcblist_segempty(rsclp, RCU_NEXT_READY_TAIL)], 1599 1593 rcu_segcblist_segempty(rsclp, RCU_NEXT_READY_TAIL) ? "" : bufr, 1600 1594 ".N"[!rcu_segcblist_segempty(rsclp, RCU_NEXT_TAIL)], 1595 + rcu_segcblist_segempty(rsclp, RCU_NEXT_TAIL) ? "" : bufn, 1601 1596 ".B"[!!rcu_cblist_n_cbs(&rdp->nocb_bypass)], 1597 + !rcu_cblist_n_cbs(&rdp->nocb_bypass) ? "" : bufb, 1602 1598 rcu_segcblist_n_cbs(&rdp->cblist), 1603 1599 rdp->nocb_cb_kthread ? task_state_to_char(rdp->nocb_cb_kthread) : '.', 1604 1600 rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_cb_kthread) : -1,