From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
mingo@kernel.org, jiangshanlai@gmail.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
"Paul E. McKenney" <paulmck@kernel.org>,
Neeraj Upadhyay <neeraj.iitr10@gmail.com>
Subject: [PATCH rcu 17/17] rcutorture: Combine n_max_cbs from all kthreads in a callback flood
Date: Wed, 1 Dec 2021 16:43:36 -0800 [thread overview]
Message-ID: <20211202004337.3130175-17-paulmck@kernel.org> (raw)
In-Reply-To: <20211202004245.GA3129966@paulmck-ThinkPad-P17-Gen-1>
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>
---
kernel/rcu/rcutorture.c | 9 +++++++++
.../testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 1e8360d159200..33ea446101b30 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2170,6 +2170,7 @@ struct rcu_fwd {
static DEFINE_MUTEX(rcu_fwd_mutex);
static struct rcu_fwd *rcu_fwds;
static unsigned long rcu_fwd_seq;
+static atomic_long_t rcu_fwd_max_cbs;
static bool rcu_fwd_emergency_stop;
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_launders_sa,
n_max_gps, n_max_cbs, cver, gps);
+ atomic_long_add(n_max_cbs, &rcu_fwd_max_cbs);
rcu_torture_fwd_cb_hist(rfp);
}
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. */
static int rcu_torture_fwd_prog(void *args)
{
+ bool firsttime = true;
+ long max_cbs;
int oldnice = task_nice(current);
unsigned long oldseq = READ_ONCE(rcu_fwd_seq);
struct rcu_fwd *rfp = args;
@@ -2503,6 +2507,11 @@ static int rcu_torture_fwd_prog(void *args)
if (!rfp->rcu_fwd_id) {
schedule_timeout_interruptible(fwd_progress_holdoff * HZ);
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);
} else {
while (READ_ONCE(rcu_fwd_seq) == oldseq)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index fbdf162b6acdf..1c4c2c727dad1 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -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.]*] //' |
awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
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"
then
echo "$configfile ------- " $stopstate
--
2.31.1.189.g2e36527f23
prev parent reply other threads:[~2021-12-02 0:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 0:42 [PATCH rcu 0/17] Torture-test updates for v5.17 Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 01/17] rcutorture: Sanitize RCUTORTURE_RDR_MASK Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 02/17] rcutorture: More thoroughly test nested readers Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 03/17] rcutorture: Suppress pi-lock-across read-unlock testing for Tiny SRCU Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 04/17] refscale: Simplify the errexit checkpoint Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 05/17] refscale: Prevent buffer to pr_alert() being too long Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 06/17] refscale: Always log the error message Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 07/17] refscale: Add missing '\n' to flush message Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 08/17] scftorture: " Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 09/17] scftorture: Remove unused SCFTORTOUT Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 10/17] rcuscale: Always log error message Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 11/17] scftorture: " Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 12/17] locktorture,rcutorture,torture: " Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 13/17] rcutorture: Avoid soft lockup during cpu stall Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 14/17] rcutorture: Test RCU-tasks multiqueue callback queueing Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 15/17] rcutorture: Enable multiple concurrent callback-flood kthreads Paul E. McKenney
2021-12-02 0:43 ` [PATCH rcu 16/17] rcutorture: Add ability to limit callback-flood intensity Paul E. McKenney
2021-12-02 0:43 ` Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211202004337.3130175-17-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=neeraj.iitr10@gmail.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox