diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2020-11-17 22:30:18 +0300 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2021-01-07 04:17:19 +0300 |
commit | ae19aaafae95a5487469433e9cae4c208f8d15cd (patch) | |
tree | 35b99f140c8f40c06954ab3e5608ff59cebdf21c /include/linux/torture.h | |
parent | 682189a3f874db57b3e755512f2a2953f61fc54e (diff) | |
download | linux-ae19aaafae95a5487469433e9cae4c208f8d15cd.tar.xz |
torture: Add fuzzed hrtimer-based sleep functions
This commit adds torture_hrtimeout_ns(), torture_hrtimeout_us(),
torture_hrtimeout_ms(), torture_hrtimeout_jiffies(), and
torture_hrtimeout_s(), each of which uses hrtimers to block for a fuzzed
time interval. These functions are intended to be used by the various
torture tests to decouple wakeups from the timer wheel, thus providing
more opportunity for Murphy to insert destructive race conditions.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r-- | include/linux/torture.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h index 7f65bd1dd307..32941f8106b2 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -61,6 +61,13 @@ static inline void torture_random_init(struct torture_random_state *trsp) trsp->trs_count = 0; } +/* Definitions for high-resolution-timer sleeps. */ +int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_state *trsp); +int torture_hrtimeout_us(u32 baset_us, u32 fuzzt_ns, struct torture_random_state *trsp); +int torture_hrtimeout_ms(u32 baset_ms, u32 fuzzt_us, struct torture_random_state *trsp); +int torture_hrtimeout_jiffies(u32 baset_j, struct torture_random_state *trsp); +int torture_hrtimeout_s(u32 baset_s, u32 fuzzt_ms, struct torture_random_state *trsp); + /* Task shuffler, which causes CPUs to occasionally go idle. */ void torture_shuffle_task_register(struct task_struct *tp); int torture_shuffle_init(long shuffint); |