Skip to contentSkip to conversation

Fix: consumerd main: needs to be a registered RCU thread

PATCH New Mathieu Desnoyers 2 participants 2 messages Jan 19, 2017 – Jan 20, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 Fix: consumerd main: needs to be a registered RCU thread

main->lttng_consumer_destroy->destroy_data_stream_ht requires a RCU read-side lock.

---
 src/bin/lttng-consumerd/lttng-consumerd.c | 4 ++++
 1 file changed, 4 insertions(+)
src/bin/lttng-consumerd/lttng-consumerd.c +4 -0
index 7f78c4e..2f8eed1 100644
@@ -308,6 +308,8 @@ int main(int argc, char **argv)
 	void *status;
 	struct lttng_consumer_local_data *tmp_ctx;
 
+	rcu_register_thread();
+
 	if (set_signal_handler()) {
 		retval = -1;
 		goto exit_set_signal_handler;
@@ -643,6 +645,8 @@ exit_health_consumerd_cleanup:
 exit_options:
 exit_set_signal_handler:
 
+	rcu_unregister_thread();
+
 	if (!retval) {
 		exit(EXIT_SUCCESS);
 	} else {
Signature · 6 lines
2.1.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

Re: [PATCH lttng-tools 1/2] Fix: thread_dispatch_ust_registration needs to be a RCU thread

In reply to a message not in the archive

Both patches were merged in master, stable2-9 and stable-2.8.

Thanks!
Jérémie

Quoted 31 lines · Mathieu Desnoyers

It uses a read-side lock.

---
 src/bin/lttng-sessiond/main.c | 3 +++
 1 file changed, 3 insertions(+)
src/bin/lttng-sessiond/main.c +3 -1
index 40670dd..172f8c2 100644
@@ -1855,6 +1855,8 @@ static void *thread_dispatch_ust_registration(void *data)
                .count = 0,
        };
 
+       rcu_register_thread();
+
        health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH);
 
        if (testpoint(sessiond_thread_app_reg_dispatch)) {
@@ -2088,6 +2090,7 @@ error_testpoint:
                ERR("Health error occurred in %s", __func__);
        }
        health_unregister(health_sessiond);
+       rcu_unregister_thread();
        return NULL;
 }
 
--

2.1.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev