Commit 7b6c1648 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Uladzislau Rezki (Sony)
Browse files

rcutorture: Use finer-grained timeouts for rcu_torture_writer() polling



The rcu_torture_writer() polling currently uses timeouts ranging from
zero to 16 milliseconds to wait for the polled grace period to end.
This works, but it would be better to have a higher probability of
exercising races with the code that cleans up after a grace period.
This commit therefore switches from these millisecond-scale timeouts
to timeouts ranging from zero to 128 microseconds, and with a full
microsecond's worth of timeout fuzz.

Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Signed-off-by: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
parent 579a05da
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1561,7 +1561,7 @@ rcu_torture_writer(void *arg)
							break;
						}
					WARN_ON_ONCE(ulo_size > 0 && i >= ulo_size);
					torture_hrtimeout_jiffies(torture_random(&rand) % 16,
					torture_hrtimeout_us(torture_random(&rand) % 128, 1000,
							     &rand);
				}
				rcu_torture_pipe_update(old_rp);
@@ -1582,7 +1582,7 @@ rcu_torture_writer(void *arg)
							break;
						}
					WARN_ON_ONCE(rgo_size > 0 && i >= rgo_size);
					torture_hrtimeout_jiffies(torture_random(&rand) % 16,
					torture_hrtimeout_us(torture_random(&rand) % 128, 1000,
							     &rand);
				}
				rcu_torture_pipe_update(old_rp);
@@ -1592,7 +1592,7 @@ rcu_torture_writer(void *arg)
				gp_snap = cur_ops->start_gp_poll_exp();
				rcu_torture_writer_state = RTWS_POLL_WAIT_EXP;
				while (!cur_ops->poll_gp_state_exp(gp_snap))
					torture_hrtimeout_jiffies(torture_random(&rand) % 16,
					torture_hrtimeout_us(torture_random(&rand) % 128, 1000,
							     &rand);
				rcu_torture_pipe_update(old_rp);
				break;
@@ -1601,7 +1601,7 @@ rcu_torture_writer(void *arg)
				cur_ops->start_gp_poll_exp_full(&gp_snap_full);
				rcu_torture_writer_state = RTWS_POLL_WAIT_EXP_FULL;
				while (!cur_ops->poll_gp_state_full(&gp_snap_full))
					torture_hrtimeout_jiffies(torture_random(&rand) % 16,
					torture_hrtimeout_us(torture_random(&rand) % 128, 1000,
							     &rand);
				rcu_torture_pipe_update(old_rp);
				break;