X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-relayd%2Fsession.c;h=2300e5f1adab5c6c2190af4829cb9c2767f3e2f3;hb=1d8d032800b64945d90c7b5a7b8e9316e733a4b1;hp=14ae874ea782ef45624447659d988c1bd3a05258;hpb=bda7c7b9b4c633de16f3d8bf109f9d21fdd9a5fb;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index 14ae874ea..2300e5f1a 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -131,7 +131,14 @@ static void rcu_destroy_session(struct rcu_head *rcu_head) struct relay_session *session = caa_container_of(rcu_head, struct relay_session, rcu_node); - + /* + * Since each trace has a reference on the session, it means + * that if we are at the point where we teardown the session, no + * trace belonging to that session exist at this point. + * Calling lttng_ht_destroy in call_rcu worker thread so we + * don't hold the RCU read-side lock while calling it. + */ + lttng_ht_destroy(session->ctf_traces_ht); free(session); } @@ -155,12 +162,6 @@ static void destroy_session(struct relay_session *session) ret = session_delete(session); assert(!ret); - /* - * Since each trace has a reference on the session, it means - * that if we are at the point where we teardown the session, no - * trace belonging to that session exist at this point. - */ - lttng_ht_destroy(session->ctf_traces_ht); call_rcu(&session->rcu_node, rcu_destroy_session); }