]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: fd/poller: turn polled_mask to group-local IDs
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Jul 2022 08:37:31 +0000 (10:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 18:16:30 +0000 (20:16 +0200)
commit63022128a522b56639bfa42b7c07a8085702f6e6
tree6876df6dab9a062ed96a2f4a0dc468af528b371f
parent0dc1cc93b669df7674ec9036f217db1bceb68b01
MEDIUM: fd/poller: turn polled_mask to group-local IDs

This changes the signification of each bit in the polled_mask so that
now each bit represents a local thread ID for the current group instead
of a global thread ID. As such, all tests now apply to ltid_bit instead
of tid_bit.

No particular check was made to verify that the FD's tgid matches the
current one because there should be no case where this is not true. A
check was added in epoll's __fd_clo() to confirm it never differs unless
expected (soft stop under thread isolation, or master in starting mode
going to exec mode), but that doesn't prevent from doing the job: it
only consists in checking in the group's threads those that are still
polling this FD and to remove them.

Some atomic loads were added at the various locations, and most repetitive
references to polled_mask[fd].xx were turned to a local copy instead making
the code much more clear.
src/ev_epoll.c
src/ev_evports.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c