History

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.

Paul E. McKenney committed 12 years ago

Commit da601c61 parent 2f66dbc1 file · +2 −1Browse files

Showing the changes to kernel/locking (1 of 1 file). Show all

Unified · Split

kernel/locking/locktorture.c+2−1
@@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg) · 218 unmodified lines
219219 set_user_nice(current, 19);
220220
221221 do {
222− schedule_timeout_uninterruptible(1);
222+ if ((torture_random(&rand) & 0xfffff) == 0)
223+ schedule_timeout_uninterruptible(1);
223224 cur_ops->writelock();
224225 if (WARN_ON_ONCE(lock_is_write_held))
225226 lwsp->n_write_lock_fail++;