aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/locking/locktorture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-08-30 21:48:23 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-11-06 17:13:29 -0800
commit3480d6774f07341e3e1cf3114f58bef98ea58ae0 (patch)
tree8fda088de1112129a861d85de5697cb5b0965898 /kernel/locking/locktorture.c
parenttorture: Don't kill gdb sessions (diff)
downloadlinux-dev-3480d6774f07341e3e1cf3114f58bef98ea58ae0.tar.xz
linux-dev-3480d6774f07341e3e1cf3114f58bef98ea58ae0.zip
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: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to '')
-rw-r--r--kernel/locking/locktorture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 62d215b2e39f..316531de2a81 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -60,6 +60,7 @@ static struct task_struct **reader_tasks;
static bool lock_is_write_held;
static bool lock_is_read_held;
+static unsigned long last_lock_release;
struct lock_stress_stats {
long n_lock_fail;
@@ -632,6 +633,7 @@ static int lock_torture_writer(void *arg)
lwsp->n_lock_acquired++;
cxt.cur_ops->write_delay(&rand);
lock_is_write_held = false;
+ WRITE_ONCE(last_lock_release, jiffies);
cxt.cur_ops->writeunlock();
stutter_wait("lock_torture_writer");