]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: traces: always mark trace_source as thread-aligned
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2026 15:19:48 +0000 (16:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2026 15:22:59 +0000 (16:22 +0100)
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

index 2fa63bc84a04c91d639ede3fbed635370096880b..2d32d99f2f754248b234e96edd60faf861374dae 100644 (file)
@@ -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 */