]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: tinfo: better align fields in thread_ctx
authorWilly Tarreau <w@1wt.eu>
Tue, 30 Apr 2024 13:22:46 +0000 (15:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 May 2024 15:18:13 +0000 (17:18 +0200)
commit53461e4d940c488a62fbe44687de503abf61d105
treebbbe57e704fda0298166b73e66db5c26060df6a9
parenta5d6a7998669bffdc5c4138f5dfbc4a25e119ca3
CLEANUP: tinfo: better align fields in thread_ctx

The introduction of buffer_wq[] in thread_ctx pushed a few fields around
and the cache line alignment is less satisfying. And more importantly, even
before this, all the lists in the local parts were 8-aligned, with the first
one split across two cache lines.

We can do better:
  - sched_profile_entry is not atomic at all, the data it points to is
    atomic so it doesn't need to be in the atomic-only region, and it can
    fill the 8-hole before the lists
  - the align(2*void) that was only before tasklets[] moves before all
    lists (and it's a nop for now)

This now makes the lists and buffer_wq[] start on a cache line boundary,
leaves 48 bytes after the lists before the atomic-only cache line, and
leaves a full cache line at the end for 128-alignment. This way we still
have plenty of room in both parts with better aligned fields.
include/haproxy/tinfo-t.h