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>
This commit is contained in:
Paul E. McKenney 2021-11-23 13:51:11 -08:00
parent 613b00fbe6
commit 53b541fbdb
2 changed files with 10 additions and 1 deletions

View File

@ -2170,6 +2170,7 @@ struct rcu_fwd {
static DEFINE_MUTEX(rcu_fwd_mutex); static DEFINE_MUTEX(rcu_fwd_mutex);
static struct rcu_fwd *rcu_fwds; static struct rcu_fwd *rcu_fwds;
static unsigned long rcu_fwd_seq; static unsigned long rcu_fwd_seq;
static atomic_long_t rcu_fwd_max_cbs;
static bool rcu_fwd_emergency_stop; static bool rcu_fwd_emergency_stop;
static void rcu_torture_fwd_cb_hist(struct rcu_fwd *rfp) 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)
n_launders + n_max_cbs - n_launders_cb_snap, n_launders + n_max_cbs - n_launders_cb_snap,
n_launders, n_launders_sa, n_launders, n_launders_sa,
n_max_gps, n_max_cbs, cver, gps); n_max_gps, n_max_cbs, cver, gps);
atomic_long_add(n_max_cbs, &rcu_fwd_max_cbs);
rcu_torture_fwd_cb_hist(rfp); rcu_torture_fwd_cb_hist(rfp);
} }
schedule_timeout_uninterruptible(HZ); /* Let CBs drain. */ schedule_timeout_uninterruptible(HZ); /* Let CBs drain. */
@ -2489,6 +2491,8 @@ static struct notifier_block rcutorture_oom_nb = {
/* Carry out grace-period forward-progress testing. */ /* Carry out grace-period forward-progress testing. */
static int rcu_torture_fwd_prog(void *args) static int rcu_torture_fwd_prog(void *args)
{ {
bool firsttime = true;
long max_cbs;
int oldnice = task_nice(current); int oldnice = task_nice(current);
unsigned long oldseq = READ_ONCE(rcu_fwd_seq); unsigned long oldseq = READ_ONCE(rcu_fwd_seq);
struct rcu_fwd *rfp = args; struct rcu_fwd *rfp = args;
@ -2503,6 +2507,11 @@ static int rcu_torture_fwd_prog(void *args)
if (!rfp->rcu_fwd_id) { if (!rfp->rcu_fwd_id) {
schedule_timeout_interruptible(fwd_progress_holdoff * HZ); schedule_timeout_interruptible(fwd_progress_holdoff * HZ);
WRITE_ONCE(rcu_fwd_emergency_stop, false); WRITE_ONCE(rcu_fwd_emergency_stop, false);
if (!firsttime) {
max_cbs = atomic_long_xchg(&rcu_fwd_max_cbs, 0);
pr_alert("%s n_max_cbs: %ld\n", __func__, max_cbs);
}
firsttime = false;
WRITE_ONCE(rcu_fwd_seq, rcu_fwd_seq + 1); WRITE_ONCE(rcu_fwd_seq, rcu_fwd_seq + 1);
} else { } else {
while (READ_ONCE(rcu_fwd_seq) == oldseq) while (READ_ONCE(rcu_fwd_seq) == oldseq)

View File

@ -25,7 +25,7 @@ stopstate="`grep 'End-test grace-period state: g' $i/console.log 2> /dev/null |
tail -1 | sed -e 's/^\[[ 0-9.]*] //' | tail -1 | sed -e 's/^\[[ 0-9.]*] //' |
awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' | awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
tr -d '\012\015'`" tr -d '\012\015'`"
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 }'`" 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 }'`"
if test -z "$ngps" if test -z "$ngps"
then then
echo "$configfile ------- " $stopstate echo "$configfile ------- " $stopstate