rcutorture: Reduce priority of forward-progress testing
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 20 Jul 2018 19:18:11 +0000 (12:18 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 29 Aug 2018 16:20:48 +0000 (09:20 -0700)
On !SMP tests, the forward-progress kthread might prevent RCU's
grace-period kthread from running, which would defeat RCU's
forward-progress measures.  On PREEMPT tests without RCU priority
boosting, the forward-progress kthread might preempt a reader for an
extended time period, which would also defeat RCU's forward-progress
measures.  This commit therefore reduced rcutorture's forward-progress
kthread's priority in those cases.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcutorture.c

index 9622192ec5c9568f684cbdcd21bfc03f51ffc908..ac487ea8d245977940b43057ec0843b0001f0231 100644 (file)
@@ -1710,6 +1710,8 @@ static int rcu_torture_fwd_prog(void *args)
        static DEFINE_TORTURE_RANDOM(trs);
 
        VERBOSE_TOROUT_STRING("rcu_torture_fwd_progress task started");
+       if (!IS_ENABLED(CONFIG_SMP) || !IS_ENABLED(CONFIG_RCU_BOOST))
+               set_user_nice(current, MAX_NICE);
        if  (cur_ops->call && cur_ops->sync && cur_ops->cb_barrier) {
                init_rcu_head_on_stack(&fcs.rh);
                cur_ops->call(&fcs.rh, rcu_torture_fwd_prog_cb);