]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcutorture: Make in-kernel-loop testing more brutal
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 15 Aug 2019 18:43:53 +0000 (11:43 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 5 Oct 2019 18:50:18 +0000 (11:50 -0700)
The rcu_torture_fwd_prog_nr() tests the ability of RCU to tolerate
in-kernel busy loops.  It invokes rcu_torture_fwd_prog_cond_resched()
within its delay loop, which, in PREEMPT && NO_HZ_FULL kernels results
in the occasional direct call to schedule().  Now, this direct call to
schedule() is appropriate for call_rcu() flood testing, in which either
the kernel should restrain itself or userspace transitions will supply
the needed restraint.  But in pure in-kernel loops, the occasional
cond_resched() should do the job.

This commit therefore makes rcu_torture_fwd_prog_nr() use cond_resched()
instead of rcu_torture_fwd_prog_cond_resched() in order to increase the
brutality of this aspect of rcutorture testing.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c

index 5ac4672938032eecaf662a86025dcdc953bb781f..df1caa93ee63fbbbf5c249798161a9b814cc38a6 100644 (file)
@@ -1806,7 +1806,7 @@ static void rcu_torture_fwd_prog_nr(int *tested, int *tested_tries)
                udelay(10);
                cur_ops->readunlock(idx);
                if (!fwd_progress_need_resched || need_resched())
-                       rcu_torture_fwd_prog_cond_resched(1);
+                       cond_resched();
        }
        (*tested_tries)++;
        if (!time_before(jiffies, stopat) &&