Commit da601c63 authored by Paul E. McKenney's avatar Paul E. McKenney

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 2f66dbc1
...@@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg) ...@@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg)
set_user_nice(current, 19); set_user_nice(current, 19);
do { do {
schedule_timeout_uninterruptible(1); if ((torture_random(&rand) & 0xfffff) == 0)
schedule_timeout_uninterruptible(1);
cur_ops->writelock(); cur_ops->writelock();
if (WARN_ON_ONCE(lock_is_write_held)) if (WARN_ON_ONCE(lock_is_write_held))
lwsp->n_write_lock_fail++; lwsp->n_write_lock_fail++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment