From: Mathieu Desnoyers Date: Thu, 18 Aug 2016 20:07:30 +0000 (-0400) Subject: Fix: perf counter context deadlock X-Git-Tag: v2.8.2~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=246bb09aab94e1d50877eb585e8f21a13acf270a;p=lttng-ust.git Fix: perf counter context deadlock Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-statedump.c b/liblttng-ust/lttng-ust-statedump.c index c2926aec..4242579f 100644 --- a/liblttng-ust/lttng-ust-statedump.c +++ b/liblttng-ust/lttng-ust-statedump.c @@ -334,12 +334,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; }