From 868dd3e88b82dd6569ad44787914f42c61015c02 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 23 Feb 2026 16:19:48 +0100 Subject: [PATCH] MINOR: traces: always mark trace_source as thread-aligned Some perf profiles occasionally show that reading the trace source's state can take some time, which is not expected at all. It just happens that the trace_source is not cache-aligned so depending on linkage, it may share a cache line with a more active variable, thereby inducing a slow down to all threads trying to read the variable. Let's always mark it aligned to avoid this. For now the problem was not observed again. --- include/haproxy/trace-t.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/trace-t.h b/include/haproxy/trace-t.h index 2fa63bc84..2d32d99f2 100644 --- a/include/haproxy/trace-t.h +++ b/include/haproxy/trace-t.h @@ -192,7 +192,7 @@ struct trace_source { const void *lockon_ptr; // what to lockon when lockon is set const struct trace_source *follow; // other trace source's tracker to follow int cmdline; // true if source was activated via -dt command line args -}; +} THREAD_ALIGNED(); #endif /* _HAPROXY_TRACE_T_H */