Fix: perf counter context deadlock
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Aug 2016 20:07:30 +0000 (16:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Aug 2016 23:29:22 +0000 (19:29 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-statedump.c

index 2fb8f34d9b4f4e34d803813498187273441fc487..644af303aa9ceae55bae10d899571d8999e02b26 100644 (file)
@@ -590,12 +590,22 @@ int do_baddr_statedump(void *owner)
  * session, statedumps from different processes may be
  * interleaved. The vpid context should be used to identify which
  * events belong to which process.
+ *
+ * Grab the ust_lock outside of the RCU read-side lock because we
+ * perform synchronize_rcu with the ust_lock held, which can trigger
+ * deadlocks otherwise.
  */
 int do_lttng_ust_statedump(void *owner)
 {
+       ust_lock_nocheck();
        trace_statedump_start(owner);
+       ust_unlock();
+
        do_baddr_statedump(owner);
+
+       ust_lock_nocheck();
        trace_statedump_end(owner);
+       ust_unlock();
 
        return 0;
 }
This page took 0.027095 seconds and 4 git commands to generate.