]> git.kaiwu.me - haproxy.git/commit
MEDIUM: polling: make update_fd_polling() not care about sleeping threads
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Jun 2022 16:38:06 +0000 (18:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 17:15:14 +0000 (19:15 +0200)
commit962e5ba72bc500d7d6e263c43a43da2069391214
tree7790759d2e5ea3f23c1a3d942f1de44b9540998f
parent058b2c1015dc8f6869757d0e9310454fa7669c8e
MEDIUM: polling: make update_fd_polling() not care about sleeping threads

Till now, update_fd_polling() used to check if all the target threads were
sleeping, and only then would wake an owning thread up. This causes several
problems among which the need for the sleeping_thread_mask and the fact that
by the time we wake one thread up, it has changed.

This commit changes this by leaving it to wake_thread() to perform this
check on the selected thread, since wake_thread() is already capable of
doing this now. Concretely speaking, for updt_fd_polling() it will mean
performing one computation of an ffsl() before knowing the sleeping status
on a global FD state change (which is very rare and not important here,
as it basically happens after relaxing a rate-limit (i.e. once a second
at beast) or after enabling a frontend from the CLI); thus we don't care.
src/fd.c