From: Francis Deslauriers Date: Wed, 20 Jan 2021 21:18:09 +0000 (-0500) Subject: Cleanup: remove outdated comments on RCU requirements X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ff9fe3137fc1aec6e18ebbf7c218907698206e7d;p=deliverable%2Flttng-tools.git Cleanup: remove outdated comments on RCU requirements The ht-cleanup thread was introduced to work-around the limitation that the hash table destroy could not be called from a RCU read-side critical section because of requirements from the rculfhash API, some comments stating that destruction code should not be called from RCU read-side critical sections were left in place when they should in fact have been removed. This ht-cleanup thread work around was introduced by the following commit: commit 0b2dc8df2a6d7b3341a72a04767dd6328907c97c Author: Mathieu Desnoyers Date: Fri Jun 14 07:44:52 2013 -0400 Fix: hash table cleanup call_rcu deadlock Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: Ifdaa63e6146b51fdb251e75795e382b5f390f7be --- diff --git a/src/bin/lttng-sessiond/buffer-registry.cpp b/src/bin/lttng-sessiond/buffer-registry.cpp index aca8ec1f2..392881827 100644 --- a/src/bin/lttng-sessiond/buffer-registry.cpp +++ b/src/bin/lttng-sessiond/buffer-registry.cpp @@ -574,8 +574,6 @@ void buffer_reg_channel_destroy(struct buffer_reg_channel *regp, /* * Destroy a buffer registry session with the given domain. - * - * Should *NOT* be called with RCU read-side lock held. */ static void buffer_reg_session_destroy(struct buffer_reg_session *regp, enum lttng_domain_type domain) @@ -735,8 +733,6 @@ void buffer_reg_pid_destroy(struct buffer_reg_pid *regp) /* * Destroy per PID and UID registry hash table. - * - * Should *NOT* be called with RCU read-side lock held. */ void buffer_reg_destroy_registries(void) { diff --git a/src/bin/lttng-sessiond/client.cpp b/src/bin/lttng-sessiond/client.cpp index 0820bca76..ae5580487 100644 --- a/src/bin/lttng-sessiond/client.cpp +++ b/src/bin/lttng-sessiond/client.cpp @@ -416,8 +416,6 @@ error: * Copy consumer output from the tracing session to the domain session. The * function also applies the right modification on a per domain basis for the * trace files destination directory. - * - * Should *NOT* be called with RCU read-side lock held. */ static int copy_session_consumer(int domain, struct ltt_session *session) { @@ -481,8 +479,6 @@ error: /* * Create an UST session and add it to the session ust list. - * - * Should *NOT* be called with RCU read-side lock held. */ static int create_ust_session(struct ltt_session *session, const struct lttng_domain *domain) @@ -919,8 +915,6 @@ end: * "sock" is only used for special-case var. len data. * A command may assume the ownership of the socket, in which case its value * should be set to -1. - * - * Should *NOT* be called with RCU read-side lock held. */ static int process_client_msg(struct command_ctx *cmd_ctx, int *sock, int *sock_error) diff --git a/src/bin/lttng-sessiond/consumer.cpp b/src/bin/lttng-sessiond/consumer.cpp index f7a92cb3d..ba4e2470f 100644 --- a/src/bin/lttng-sessiond/consumer.cpp +++ b/src/bin/lttng-sessiond/consumer.cpp @@ -554,8 +554,6 @@ void consumer_destroy_output_sockets(struct consumer_output *obj) /* * Delete the consumer_output object from the list and free the ptr. - * - * Should *NOT* be called with RCU read-side lock held. */ static void consumer_release_output(struct urcu_ref *ref) { @@ -582,8 +580,6 @@ void consumer_output_get(struct consumer_output *obj) /* * Put the consumer_output object. - * - * Should *NOT* be called with RCU read-side lock held. */ void consumer_output_put(struct consumer_output *obj) { @@ -595,8 +591,6 @@ void consumer_output_put(struct consumer_output *obj) /* * Copy consumer output and returned the newly allocated copy. - * - * Should *NOT* be called with RCU read-side lock held. */ struct consumer_output *consumer_copy_output(struct consumer_output *src) { diff --git a/src/bin/lttng-sessiond/trace-kernel.cpp b/src/bin/lttng-sessiond/trace-kernel.cpp index 8d8c63e5d..cbe4c3c89 100644 --- a/src/bin/lttng-sessiond/trace-kernel.cpp +++ b/src/bin/lttng-sessiond/trace-kernel.cpp @@ -999,8 +999,6 @@ void trace_kernel_destroy_metadata(struct ltt_kernel_metadata *metadata) /* * Cleanup kernel session structure - * - * Should *NOT* be called with RCU read-side lock held. */ void trace_kernel_destroy_session(struct ltt_kernel_session *session) { diff --git a/src/bin/lttng-sessiond/trace-ust.cpp b/src/bin/lttng-sessiond/trace-ust.cpp index ce85c3236..ec62eef09 100644 --- a/src/bin/lttng-sessiond/trace-ust.cpp +++ b/src/bin/lttng-sessiond/trace-ust.cpp @@ -1387,8 +1387,6 @@ static void destroy_domain_global(struct ltt_ust_domain_global *dom) /* * Cleanup ust session structure, keeping data required by * destroy notifier. - * - * Should *NOT* be called with RCU read-side lock held. */ void trace_ust_destroy_session(struct ltt_ust_session *session) { diff --git a/src/bin/lttng-sessiond/ust-app.cpp b/src/bin/lttng-sessiond/ust-app.cpp index f12262101..570d011a7 100644 --- a/src/bin/lttng-sessiond/ust-app.cpp +++ b/src/bin/lttng-sessiond/ust-app.cpp @@ -1004,8 +1004,6 @@ void delete_ust_app_session(int sock, struct ust_app_session *ua_sess, /* * Delete a traceable application structure from the global list. Never call * this function outside of a call_rcu call. - * - * RCU read side lock should _NOT_ be held when calling this function. */ static void delete_ust_app(struct ust_app *app) @@ -4618,8 +4616,6 @@ error: /* * Free and clean all traceable apps of the global list. - * - * Should _NOT_ be called with RCU read-side lock held. */ void ust_app_clean_list(void) {