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

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>

+10 -1
+9
kernel/rcu/rcutorture.c
··· 2170 2170 static DEFINE_MUTEX(rcu_fwd_mutex); 2171 2171 static struct rcu_fwd *rcu_fwds; 2172 2172 static unsigned long rcu_fwd_seq; 2173 + static atomic_long_t rcu_fwd_max_cbs; 2173 2174 static bool rcu_fwd_emergency_stop; 2174 2175 2175 2176 static void rcu_torture_fwd_cb_hist(struct rcu_fwd *rfp) ··· 2429 2428 n_launders + n_max_cbs - n_launders_cb_snap, 2430 2429 n_launders, n_launders_sa, 2431 2430 n_max_gps, n_max_cbs, cver, gps); 2431 + atomic_long_add(n_max_cbs, &rcu_fwd_max_cbs); 2432 2432 rcu_torture_fwd_cb_hist(rfp); 2433 2433 } 2434 2434 schedule_timeout_uninterruptible(HZ); /* Let CBs drain. */ ··· 2491 2489 /* Carry out grace-period forward-progress testing. */ 2492 2490 static int rcu_torture_fwd_prog(void *args) 2493 2491 { 2492 + bool firsttime = true; 2493 + long max_cbs; 2494 2494 int oldnice = task_nice(current); 2495 2495 unsigned long oldseq = READ_ONCE(rcu_fwd_seq); 2496 2496 struct rcu_fwd *rfp = args; ··· 2507 2503 if (!rfp->rcu_fwd_id) { 2508 2504 schedule_timeout_interruptible(fwd_progress_holdoff * HZ); 2509 2505 WRITE_ONCE(rcu_fwd_emergency_stop, false); 2506 + if (!firsttime) { 2507 + max_cbs = atomic_long_xchg(&rcu_fwd_max_cbs, 0); 2508 + pr_alert("%s n_max_cbs: %ld\n", __func__, max_cbs); 2509 + } 2510 + firsttime = false; 2510 2511 WRITE_ONCE(rcu_fwd_seq, rcu_fwd_seq + 1); 2511 2512 } else { 2512 2513 while (READ_ONCE(rcu_fwd_seq) == oldseq)
+1 -1
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
··· 25 25 tail -1 | sed -e 's/^\[[ 0-9.]*] //' | 26 26 awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' | 27 27 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 }'`" 29 29 if test -z "$ngps" 30 30 then 31 31 echo "$configfile ------- " $stopstate