X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=ee19ef840d339cc6b4a4342b529e1c4f6b375a44;hb=c4d5de9d68e5fde4c5ef30f88f2b8aa5751ea031;hp=916a2b76993edc96111365760077c4a5951cfeeb;hpb=ddcb67725554adb78976b818c445fff154ecd962;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 916a2b769..ee19ef840 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2371,7 +2371,12 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) int ret, clock_ret; struct timespec timeout; - /* Make sure we set the readiness flag to 0 because we are NOT ready */ + /* + * Make sure we set the readiness flag to 0 because we are NOT ready. + * This access to consumer_thread_is_ready does not need to be + * protected by consumer_data.cond_mutex (yet) since the consumer + * management thread has not been started at this point. + */ consumer_data->consumer_thread_is_ready = 0; /* Setup pthread condition */ @@ -3081,6 +3086,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock, case LTTNG_LIST_EVENTS: case LTTNG_LIST_SYSCALLS: case LTTNG_LIST_TRACKER_PIDS: + case LTTNG_DATA_PENDING: break; default: /* Setup lttng message with no payload */ @@ -5469,14 +5475,14 @@ static int set_signal_handler(void) /* * Set open files limit to unlimited. This daemon can open a large number of - * file descriptors in order to consumer multiple kernel traces. + * file descriptors in order to consume multiple kernel traces. */ static void set_ulimit(void) { int ret; struct rlimit lim; - /* The kernel does not allowed an infinite limit for open files */ + /* The kernel does not allow an infinite limit for open files */ lim.rlim_cur = 65535; lim.rlim_max = 65535; @@ -6220,6 +6226,13 @@ exit_init_data: rcu_thread_offline(); rcu_unregister_thread(); + /* + * Ensure all prior call_rcu are done. call_rcu callbacks may push + * hash tables to the ht_cleanup thread. Therefore, we ensure that + * the queue is empty before shutting down the clean-up thread. + */ + rcu_barrier(); + ret = notify_thread_pipe(ht_cleanup_quit_pipe[1]); if (ret < 0) { ERR("write error on ht_cleanup quit pipe"); @@ -6249,9 +6262,6 @@ exit_health_sessiond_cleanup: exit_create_run_as_worker_cleanup: exit_options: - /* Ensure all prior call_rcu are done. */ - rcu_barrier(); - sessiond_cleanup_options(); exit_set_signal_handler: