diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-26 15:14:51 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-05-13 20:03:01 -0400 |
commit | da601c63fd3a3e6c30f85eefd5ee46397b5b439d (patch) | |
tree | d822406631e006e403310c60436c9b0e751f0d83 /kernel/locking | |
parent | 2f66dbc1e89c0eabd625c584f9b9602be58d1571 (diff) |
torture: Intensify locking test
The current lock_torture_writer() spends too much time sleeping and not
enough time hammering locks, as in an eight-CPU test will often only be
utilizing a CPU or two. This commit therefore makes lock_torture_writer()
sleep less and hammer more.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/locking')
-rw-r--r-- | kernel/locking/locktorture.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index f26b1a18e34e..b0d3e3c50672 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c | |||
@@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg) | |||
219 | set_user_nice(current, 19); | 219 | set_user_nice(current, 19); |
220 | 220 | ||
221 | do { | 221 | do { |
222 | schedule_timeout_uninterruptible(1); | 222 | if ((torture_random(&rand) & 0xfffff) == 0) |
223 | schedule_timeout_uninterruptible(1); | ||
223 | cur_ops->writelock(); | 224 | cur_ops->writelock(); |
224 | if (WARN_ON_ONCE(lock_is_write_held)) | 225 | if (WARN_ON_ONCE(lock_is_write_held)) |
225 | lwsp->n_write_lock_fail++; | 226 | lwsp->n_write_lock_fail++; |