MINOR: server: allocate a per-thread struct for the per-thread connections stuff
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2021 08:45:32 +0000 (09:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Mar 2021 14:00:24 +0000 (15:00 +0100)
commit430bf4a483bdd8257a63bc3ac88367006322f80d
tree99b2b35ca26b232560eb0a506c3c507ec780601e
parent4cdac166e0837d9d658b0f8e1419e9a9e365470f
MINOR: server: allocate a per-thread struct for the per-thread connections stuff

There are multiple per-thread lists in the listeners, which isn't the
most efficient in terms of cache, and doesn't easily allow to store all
the per-thread stuff.

Now we introduce an srv_per_thread structure which the servers will have an
array of, and place the idle/safe/avail conns tree heads into. Overall this
was a fairly mechanical change, and the array is now always initialized for
all servers since we'll put more stuff there. It's worth noting that the Lua
code still has to deal with its own deinit by itself despite being in a
global list, because its server is not dynamically allocated.
12 files changed:
include/haproxy/server-t.h
include/haproxy/server.h
src/backend.c
src/cfgparse.c
src/connection.c
src/haproxy.c
src/hlua.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/server.c
src/ssl_sock.c