Commit 3480d677 authored by Paul E. McKenney's avatar Paul E. McKenney

locktorture: Track time of last ->writeunlock()

This commit adds a last_lock_release variable that tracks the time of
the last ->writeunlock() call, which allows easier diagnosing of lock
hangs when using a kernel debugger.
Acked-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 08c79742
...@@ -60,6 +60,7 @@ static struct task_struct **reader_tasks; ...@@ -60,6 +60,7 @@ static struct task_struct **reader_tasks;
static bool lock_is_write_held; static bool lock_is_write_held;
static bool lock_is_read_held; static bool lock_is_read_held;
static unsigned long last_lock_release;
struct lock_stress_stats { struct lock_stress_stats {
long n_lock_fail; long n_lock_fail;
...@@ -632,6 +633,7 @@ static int lock_torture_writer(void *arg) ...@@ -632,6 +633,7 @@ static int lock_torture_writer(void *arg)
lwsp->n_lock_acquired++; lwsp->n_lock_acquired++;
cxt.cur_ops->write_delay(&rand); cxt.cur_ops->write_delay(&rand);
lock_is_write_held = false; lock_is_write_held = false;
WRITE_ONCE(last_lock_release, jiffies);
cxt.cur_ops->writeunlock(); cxt.cur_ops->writeunlock();
stutter_wait("lock_torture_writer"); stutter_wait("lock_torture_writer");
......
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