]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: tinfo: add a dynamic thread-group context
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Jun 2022 14:02:24 +0000 (16:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 17:15:15 +0000 (19:15 +0200)
commit03f9b35114bec1efaa9cbca21c62b0a588ca3036
treec628d05d0e52d5d73723d9cb39056d4dc2591078
parent22b2a24eb2778750d028a803e70673bc34d44217
MEDIUM: tinfo: add a dynamic thread-group context

The thread group info is not sufficient to represent a thread group's
current state as it's read-only. We also need something comparable to
the thread context to represent the aggregate state of the threads in
that group. This patch introduces ha_tgroup_ctx[] and tg_ctx for this.
It's indexed on the group id and must be cache-line aligned. The thread
masks that were global and that do not need to remain global were moved
there (want_rdv, harmless, idle).

Given that all the masks placed there now become group-specific, the
associated thread mask (tid_bit) now switches to the thread's local
bit (ltid_bit). Both are the same for nbtgroups 1 but will differ for
other values.

There's also a tg_ctx pointer in the thread so that it can be reached
from other threads.
include/haproxy/thread.h
include/haproxy/tinfo-t.h
include/haproxy/tinfo.h
src/debug.c
src/thread.c
src/wdt.c