diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-07-19 01:39:37 +0300 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-08-29 19:20:48 +0300 |
commit | 119248bec9d318ae41da8ab8f400f07e7a610cc3 (patch) | |
tree | a573e308403ac5f16cb38bd49061d09e661580f6 /kernel/rcu/rcutorture.c | |
parent | 1b27291b1ea4f1f2090fb07c3425db474cdb99ba (diff) | |
download | linux-119248bec9d318ae41da8ab8f400f07e7a610cc3.tar.xz |
rcutorture: Also use GP sequence to judge forward progress
Currently, rcutorture relies solely on the progress of
rcu_torture_writer() to judge grace-period forward progress. In theory,
this is the gold standard of forward progress, but in practice rcutorture
separately detects and reports rcu_torture_writer() stalls. This commit
therefore adds the grace-period sequence number (when provided) to the
judgment of grace-period forward progress, which makes it easier to
distinguish between failure of actual grace periods to progress on the
one hand and downstream forward-progress failures on the other.
For example, given this change, if rcu_torture_writer() stalls,
but rcu_torture_fwd_prog() does not complain, then the grace-period
computation is working, which is a hint that the failure lies in callback
processing, wakeup of the rcu_torture_writer() kthread, or similar.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/rcutorture.c')
-rw-r--r-- | kernel/rcu/rcutorture.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index fd3ce6cc8eea..dee7b45b2186 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1673,7 +1673,8 @@ static int __init rcu_torture_stall_init(void) /* Carry out grace-period forward-progress testing. */ static int rcu_torture_fwd_prog(void *args) { - unsigned long cvar; + unsigned long cver; + unsigned long gps; int idx; unsigned long stopat; bool tested = false; @@ -1681,7 +1682,8 @@ static int rcu_torture_fwd_prog(void *args) VERBOSE_TOROUT_STRING("rcu_torture_fwd_progress task started"); do { schedule_timeout_interruptible(fwd_progress_holdoff * HZ); - cvar = READ_ONCE(rcu_torture_current_version); + cver = READ_ONCE(rcu_torture_current_version); + gps = cur_ops->get_gp_seq(); stopat = jiffies + cur_ops->stall_dur() / fwd_progress_div; while (time_before(jiffies, stopat) && !torture_must_stop()) { idx = cur_ops->readlock(); @@ -1692,8 +1694,9 @@ static int rcu_torture_fwd_prog(void *args) } if (!time_before(jiffies, stopat) && !torture_must_stop()) { tested = true; - WARN_ON_ONCE(cvar == - READ_ONCE(rcu_torture_current_version)); + cver = cver == READ_ONCE(rcu_torture_current_version); + gps = rcutorture_seq_diff(cur_ops->get_gp_seq(), gps); + WARN_ON_ONCE(cver && gps < 2); } /* Avoid slow periods, better to test when busy. */ stutter_wait("rcu_torture_fwd_prog"); |