OPTIM: lb-leastconn: do not take the server lock on take_conn/drop_conn
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Feb 2021 15:14:00 +0000 (16:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Mar 2021 14:11:16 +0000 (15:11 +0100)
commit17807ed3a09c8e8b6b4e7df6797dcd0555d06089
tree799859a9921dd9e36578f71a23178aa1dbde5c32
parent7a413401483468c07d32b67b388d37eb6768e289
OPTIM: lb-leastconn: do not take the server lock on take_conn/drop_conn

The operations are only an insert and a delete into the LB tree, which
doesn't require the server's lock at all as the lbprm lock is already
held. Let's drop it. Just for the sake of cleanness, given that the
served and nbpend values used to be atomically updated, we'll use an
atomic load to read them.

(cherry picked from commit 85b2fb03580f60d20d20ecbda8c9b63804d8e900)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/lb_fwlc.c