Skip to content

Commit 53b541f

Browse files
committed
rcutorture: Combine n_max_cbs from all kthreads in a callback flood
With the addition of multiple callback-flood kthreads, the maximum number of callbacks from any one of those kthreads is reported in the rcutorture run summary. This commit changes this to report the sum of each kthread's maximum number of callbacks in a given callback-flooding episode. Cc: Neeraj Upadhyay <neeraj.iitr10@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 613b00f commit 53b541f

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

kernel/rcu/rcutorture.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,7 @@ struct rcu_fwd {
21702170
static DEFINE_MUTEX(rcu_fwd_mutex);
21712171
static struct rcu_fwd *rcu_fwds;
21722172
static unsigned long rcu_fwd_seq;
2173+
static atomic_long_t rcu_fwd_max_cbs;
21732174
static bool rcu_fwd_emergency_stop;
21742175

21752176
static void rcu_torture_fwd_cb_hist(struct rcu_fwd *rfp)
@@ -2428,6 +2429,7 @@ static void rcu_torture_fwd_prog_cr(struct rcu_fwd *rfp)
24282429
n_launders + n_max_cbs - n_launders_cb_snap,
24292430
n_launders, n_launders_sa,
24302431
n_max_gps, n_max_cbs, cver, gps);
2432+
atomic_long_add(n_max_cbs, &rcu_fwd_max_cbs);
24312433
rcu_torture_fwd_cb_hist(rfp);
24322434
}
24332435
schedule_timeout_uninterruptible(HZ); /* Let CBs drain. */
@@ -2489,6 +2491,8 @@ static struct notifier_block rcutorture_oom_nb = {
24892491
/* Carry out grace-period forward-progress testing. */
24902492
static int rcu_torture_fwd_prog(void *args)
24912493
{
2494+
bool firsttime = true;
2495+
long max_cbs;
24922496
int oldnice = task_nice(current);
24932497
unsigned long oldseq = READ_ONCE(rcu_fwd_seq);
24942498
struct rcu_fwd *rfp = args;
@@ -2503,6 +2507,11 @@ static int rcu_torture_fwd_prog(void *args)
25032507
if (!rfp->rcu_fwd_id) {
25042508
schedule_timeout_interruptible(fwd_progress_holdoff * HZ);
25052509
WRITE_ONCE(rcu_fwd_emergency_stop, false);
2510+
if (!firsttime) {
2511+
max_cbs = atomic_long_xchg(&rcu_fwd_max_cbs, 0);
2512+
pr_alert("%s n_max_cbs: %ld\n", __func__, max_cbs);
2513+
}
2514+
firsttime = false;
25062515
WRITE_ONCE(rcu_fwd_seq, rcu_fwd_seq + 1);
25072516
} else {
25082517
while (READ_ONCE(rcu_fwd_seq) == oldseq)

tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ stopstate="`grep 'End-test grace-period state: g' $i/console.log 2> /dev/null |
2525
tail -1 | sed -e 's/^\[[ 0-9.]*] //' |
2626
awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
2727
tr -d '\012\015'`"
28-
fwdprog="`grep 'rcu_torture_fwd_prog_cr Duration' $i/console.log 2> /dev/null | sed -e 's/^\[[^]]*] //' | sort -k15nr | head -1 | awk '{ print $14 " " $15 }'`"
28+
fwdprog="`grep 'rcu_torture_fwd_prog n_max_cbs: ' $i/console.log 2> /dev/null | sed -e 's/^\[[^]]*] //' | sort -k3nr | head -1 | awk '{ print $2 " " $3 }'`"
2929
if test -z "$ngps"
3030
then
3131
echo "$configfile ------- " $stopstate

0 commit comments

Comments
 (0)