]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: fd: grab the tgid before manipulating running
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Jul 2022 16:47:38 +0000 (18:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 18:16:30 +0000 (20:16 +0200)
commit0dc1cc93b669df7674ec9036f217db1bceb68b01
treeb59f69953226210dabcc9a0c8c45a8e94172e5a1
parentceffd17f52b6b1aa481365fc6f9b88e8efc436e8
MAJOR: fd: grab the tgid before manipulating running

We now grab a reference to the FD's tgid before manipulating the
running_mask so that we're certain it corresponds to our own group
(hence bits), and we drop it once we've set the bit. For now there's
no measurable performance impact in doing this, which is great. The
lock can be observed by perf top as taking a small share of the time
spent in fd_update_events(), itself taking no more than 0.28% of CPU
under 8 threads.

However due to the fact that the thread groups are not yet properly
spread across the pollers and the thread masks are still wrong, this
will trigger some BUG_ON() in fd_insert() after a few tens of thousands
of connections when threads other than those of group 1 are reached,
and this is expected.
src/fd.c