]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: listener/mq: correctly scan all bound threads under low load
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Apr 2019 16:09:13 +0000 (18:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Apr 2019 16:09:13 +0000 (18:09 +0200)
commit85d0424b20c4148a2b1f5b5a4442dd7fed44c562
treef80cff5bfd4706c38df2c1da56e10d5f25be5f48
parent636848aa86fc9f75610be769de2ae414944784de
BUG/MINOR: listener/mq: correctly scan all bound threads under low load

When iterating on the CLI using "show activity" and no other load, it
was visible that the last thread was always skipped. This was caused by
the way the thread bits were walking : t1 was updated after t2 to make
sure it never equals t2 (thus it skips t2), and in case of a tie we
choose t1. This results in the chosen thread never to equal t2 unless
the other ones already have one connection. In addition to this, t2 was
recalulated upon each pass due to the fact that only the 31th bit was
looked at instead of looking at the t2'th bit.

This patch fixes this by updating t2 after t1 so that t1 is free to
walk over all positions under equal load. No measurable performance
gains are expected from this though, but it at least removes one
strange indicator which could lead to some suspicion.

No backport is needed.
src/listener.c