Fix: don't chain RCU free
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 23 Aug 2015 03:14:44 +0000 (20:14 -0700)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 02:03:38 +0000 (22:03 -0400)
We only do a single rcu_barrier() on teardown of sessiond. Therefore, if
we chain call_rcu, they may not all be executed before exit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/trace-ust.c

index c84b0edba3428f530d2f0332c425886891d81f81..23497b1e36d44607586b138d71352ee5037c85d7 100644 (file)
@@ -664,11 +664,6 @@ static void _trace_ust_destroy_channel(struct ltt_ust_channel *channel)
 
        DBG2("Trace destroy UST channel %s", channel->name);
 
-       /* Destroying all events of the channel */
-       destroy_events(channel->events);
-       /* Destroying all context of the channel */
-       destroy_contexts(channel->ctx);
-
        free(channel);
 }
 
@@ -687,6 +682,11 @@ static void destroy_channel_rcu(struct rcu_head *head)
 
 void trace_ust_destroy_channel(struct ltt_ust_channel *channel)
 {
+       /* Destroying all events of the channel */
+       destroy_events(channel->events);
+       /* Destroying all context of the channel */
+       destroy_contexts(channel->ctx);
+
        call_rcu(&channel->node.head, destroy_channel_rcu);
 }
 
@@ -712,18 +712,18 @@ void trace_ust_delete_channel(struct lttng_ht *ht,
  */
 static void destroy_channels(struct lttng_ht *channels)
 {
-       int ret;
        struct lttng_ht_node_str *node;
        struct lttng_ht_iter iter;
 
        assert(channels);
 
        rcu_read_lock();
-
        cds_lfht_for_each_entry(channels->ht, &iter.iter, node, node) {
-               ret = lttng_ht_del(channels, &iter);
-               assert(!ret);
-               call_rcu(&node->head, destroy_channel_rcu);
+               struct ltt_ust_channel *chan =
+                       caa_container_of(node, struct ltt_ust_channel, node);
+
+               trace_ust_delete_channel(channels, chan);
+               trace_ust_destroy_channel(chan);
        }
        rcu_read_unlock();
 
This page took 0.027103 seconds and 4 git commands to generate.