rcutorture: Refrain from callback flooding during boot
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Dec 2019 23:58:41 +0000 (15:58 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Feb 2020 00:03:30 +0000 (16:03 -0800)
Additional rcutorture aggression can result in, believe it or not,
boot times in excess of three minutes on large hyperthreaded systems.
This is long enough for rcutorture to decide to do some callback flooding,
which seems a bit excessive given that userspace cannot have started
until long after boot, and it is userspace that does the real-world
callback flooding.  Worse yet, because Tiny RCU lacks forward-progress
functionality, the looping-in-the-kernel tests can also be problematic
during early boot.

This commit therefore causes rcutorture to hold off on callback
flooding until about the time that init is spawned, and the same
for looping-in-the-kernel tests for Tiny RCU.

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

index 9ba49788cb48fff93e443e5989e6621a05dd772f..08fa4ef239146adc7d808562b3d82d20875a975a 100644 (file)
@@ -1994,8 +1994,11 @@ static int rcu_torture_fwd_prog(void *args)
                schedule_timeout_interruptible(fwd_progress_holdoff * HZ);
                WRITE_ONCE(rcu_fwd_emergency_stop, false);
                register_oom_notifier(&rcutorture_oom_nb);
-               rcu_torture_fwd_prog_nr(rfp, &tested, &tested_tries);
-               rcu_torture_fwd_prog_cr(rfp);
+               if (!IS_ENABLED(CONFIG_TINY_RCU) ||
+                   rcu_inkernel_boot_has_ended())
+                       rcu_torture_fwd_prog_nr(rfp, &tested, &tested_tries);
+               if (rcu_inkernel_boot_has_ended())
+                       rcu_torture_fwd_prog_cr(rfp);
                unregister_oom_notifier(&rcutorture_oom_nb);
 
                /* Avoid slow periods, better to test when busy. */