locktorture: Prevent spinloop from escaping lock-held diagnostics

The lock_torture_writer() function uses lock_is_write_held to communicate
that the current task write-holds the lock.  Except that nothing currently
prevents the compiler from moving this wirte past the lock-hold delay,
which makes it less probable that other code will detect the fact
that the lock is in fact held.  This commit therefore adds barrier()
invocations to constrain the compiler.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 file changed