Fix: add urcu-bp TLS fixup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Jan 2015 18:27:53 +0000 (13:27 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Jan 2015 18:29:45 +0000 (13:29 -0500)
When performing a library base address statedump, the UST threads can
grab the RCU read-side lock, which touch a TLS. We should "pre-fault"
this TLS in the constructor to eliminate a deadlock involving libc
dynamic loader lock.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c

index 3df2adc6f96e0b0b16189efe6497509ea845e3da..378ca21cfc71f354a282fe4a9a521cf77319ef02 100644 (file)
@@ -335,6 +335,16 @@ void lttng_fixup_ust_mutex_nest_tls(void)
        asm volatile ("" : : "m" (URCU_TLS(ust_mutex_nest)));
 }
 
+/*
+ * Fixup urcu bp TLS.
+ */
+static
+void lttng_fixup_urcu_bp_tls(void)
+{
+       rcu_read_lock();
+       rcu_read_unlock();
+}
+
 int lttng_get_notify_socket(void *owner)
 {
        struct sock_info *info = owner;
@@ -1419,6 +1429,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
         * to be the dynamic linker mutex) and ust_lock, taken within
         * the ust lock.
         */
+       lttng_fixup_urcu_bp_tls();
        lttng_fixup_ringbuffer_tls();
        lttng_fixup_vtid_tls();
        lttng_fixup_nest_count_tls();
This page took 0.03458 seconds and 4 git commands to generate.