]> git.kaiwu.me - haproxy.git/commit
MINOR: thread: turn thread_cpu_mask_forced() into an init-time variable
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Mar 2025 09:40:49 +0000 (10:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:30 +0000 (18:30 +0100)
commitac1db9db7d8df773850d8401b7f5b283addd81e9
treeeaddc8a30a9bc437349c4b5d87eb47e5897890d3
parent3a7cc676fac0cea829f1664ef4a0cb9e0c9131c3
MINOR: thread: turn thread_cpu_mask_forced() into an init-time variable

The function is not convenient because it doesn't allow us to undo the
startup changes, and depending on where it's being used, we don't know
whether the values read have already been altered (this is not the case
right now but it's going to evolve).

Let's just compute the status during cpu_detect_usable() and set a
variable accordingly. This way we'll always read the init value, and
if needed we can even afford to reset it. Also, placing it in cpu_topo.c
limits cross-file dependencies (e.g. threads without affinity etc).
include/haproxy/cpu_topo.h
include/haproxy/thread.h
src/cfgparse.c
src/cpu_topo.c
src/thread.c