Use initial-exec TLS model
A message that is not in the archive (sent off-list or not yet received): [email protected]
Please disregard this patch. We need to investigate glibc's behavior with initial-exec's TLS initialization further before doing those changes.
Thanks,
Mathieu
Quoted 78 lines · ----- On Oct 19, 2017, at 10:51 AM, Mathieu Desnoyers…
The initial-exec TLS model is async-signal-safe, whereas the global-dynamic is not. This is especially important for the logging facility, because the first time a thread touches the TLS could be from a signal handler (correctness).
Moreover, IE is faster than GD model.
Also change the health state to the IE model, just in case we end up putting health progress reporting statements in signal handlers in the future. Given that we link against, but don't dlopen, that library, it is not using any of the IE backup pool, so there is no good reason for using the GD model.
Link:
https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#Common-Variable-AttributesSigned-off-by Mathieu Desnoyers <[email protected]>---
configure.ac | 7 ++++++- src/common/error.c | 2 +- src/common/health/health.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-)configure.ac +1
-1@@ -440,7 +440,7 @@ AC_SUBST(UUID_LIBS) AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])]) # URCU library version needed or newer -m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.9.0 is needed]) +m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.11.0 is needed]) # Check liburcu needed function callsAC_CHECK_DECL([cds_list_add], [],
configure.ac +5
-0@@ -470,6 +470,11 @@ AC_CHECK_DECL([urcu_ref_get_unless_zero], [], [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/ref.h>]] ) +#Macro added in urcu 0.11.0 +AC_CHECK_DECL([DEFINE_URCU_TLS_IE], [], + [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/tls-compat.h>]] +) + # Check for libkmod, it will be auto-neabled if found but won't fail if it's not, # it can be explicitly disabled with --without-kmod
AH_TEMPLATE([HAVE_KMOD], [Define if you have kmod support])src/common/error.c +1
-1@@ -36,7 +36,7 @@static int lttng_opt_abort_on_error =-1 ;/* TLS variable that contains the time of one single log entry. */ -DEFINE_URCU_TLS(struct log_time, error_log_time); +DEFINE_URCU_TLS_IE(struct log_time, error_log_time);
LTTNG_HIDDEN
const char*log_add_time(void)src/common/health/health.c +1
-2@@ -54,7 +54,7 @@ struct health_app { };/* Define TLS health state. */ -DEFINE_URCU_TLS(struct health_state, health_state); +DEFINE_URCU_TLS_IE(struct health_state, health_state);/* * Initialize health check subsytem. -- 2.11.0
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev