From: Willy Tarreau Date: Mon, 23 Feb 2026 15:19:48 +0000 (+0100) Subject: MINOR: traces: always mark trace_source as thread-aligned X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=868dd3e88b82dd6569ad44787914f42c61015c02;p=thirdparty%2Fhaproxy.git 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. --- 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 */