]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: listener: pre-compute some thread counts per bind_conf
authorWilly Tarreau <w@1wt.eu>
Sun, 3 Feb 2019 10:14:25 +0000 (11:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Feb 2019 13:27:07 +0000 (14:27 +0100)
commitb2b50a7784ae6b3feffa49a5010d5b82ead32ab9
treea9352ee63a799b42a63d34a5afdc67f9f9a87300
parentf3241115e7195925a30e41e363536b24111c0cc8
MINOR: listener: pre-compute some thread counts per bind_conf

In order to quickly pick a thread ID when accepting a connection, we'll
need to know certain pre-computed values derived from the thread mask,
which are counts of bits per position multiples of 1, 2, 4, 8, 16 and
32. In practice it is sufficient to compute only the 4 first ones and
store them in the bind_conf. We update the count every time the
bind_thread value is adjusted.

The fields in the bind_conf struct have been moved around a little bit
to make it easier to group all thread bit values into the same cache
line.

The function used to return a thread number is bind_map_thread_id(),
and it maps a number between 0 and 31/63 to a thread ID between 0 and
31/63, starting from the left.
include/proto/listener.h
include/types/listener.h
src/cfgparse.c
src/listener.c