Skip to content

Commit 2e57bf9

Browse files
author
Paul E. McKenney
committed
rcutorture: Use 100ms buckets for forward-progress callback histograms
This commit narrows the scope of each bucket of the forward-progress callback-invocation histograms from one second to 100 milliseconds, which aids debugging of forward-progress problems by making shorter-duration callback-invocation stalls visible. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
1 parent 2667ccc commit 2e57bf9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

kernel/rcu/rcutorture.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,8 @@ static bool rcu_fwd_emergency_stop;
16291629
#define MAX_FWD_CB_JIFFIES (8 * HZ) /* Maximum CB test duration. */
16301630
#define MIN_FWD_CB_LAUNDERS 3 /* This many CB invocations to count. */
16311631
#define MIN_FWD_CBS_LAUNDERED 100 /* Number of counted CBs. */
1632-
static long n_launders_hist[2 * MAX_FWD_CB_JIFFIES / HZ];
1632+
#define FWD_CBS_HIST_DIV 10 /* Histogram buckets/second. */
1633+
static long n_launders_hist[2 * MAX_FWD_CB_JIFFIES / (HZ / FWD_CBS_HIST_DIV)];
16331634

16341635
static void rcu_torture_fwd_cb_hist(void)
16351636
{
@@ -1642,7 +1643,8 @@ static void rcu_torture_fwd_cb_hist(void)
16421643
pr_alert("%s: Callback-invocation histogram (duration %lu jiffies):",
16431644
__func__, jiffies - rcu_fwd_startat);
16441645
for (j = 0; j <= i; j++)
1645-
pr_cont(" %ds: %ld", j + 1, n_launders_hist[j]);
1646+
pr_cont(" %ds/%d: %ld",
1647+
j + 1, FWD_CBS_HIST_DIV, n_launders_hist[j]);
16461648
pr_cont("\n");
16471649
}
16481650

@@ -1661,7 +1663,7 @@ static void rcu_torture_fwd_cb_cr(struct rcu_head *rhp)
16611663
rcu_fwd_cb_tail = &rfcp->rfc_next;
16621664
WRITE_ONCE(*rfcpp, rfcp);
16631665
WRITE_ONCE(n_launders_cb, n_launders_cb + 1);
1664-
i = ((jiffies - rcu_fwd_startat) / HZ);
1666+
i = ((jiffies - rcu_fwd_startat) / (HZ / FWD_CBS_HIST_DIV));
16651667
if (i >= ARRAY_SIZE(n_launders_hist))
16661668
i = ARRAY_SIZE(n_launders_hist) - 1;
16671669
n_launders_hist[i]++;

0 commit comments

Comments
 (0)