]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stick-table: do not take an exclusive lock when downing ref_cnt
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Oct 2022 18:10:27 +0000 (18:10 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Oct 2022 12:19:05 +0000 (14:19 +0200)
commit4be073b99bb69a871c74dc5ebb55edb664f4b2ed
tree6f7cf57f8c7221ba762ee23ab1db71d2561db2ab
parent76642223f014f89cd1f374291798499f4fba7dde
MINOR: stick-table: do not take an exclusive lock when downing ref_cnt

At plenty of places we decrement ts->ref_cnt under the write lock
because it's held. We don't technically need it to be done that way
if there's contention and an atomic could suffice. However until all
places are turned to atomic, we at least need to do that under a
read lock for now, so that we don't mix atomic and non-atomic uses.
Regardless it already brings ~1.5% req rate improvement with 3 trackers
on the same table under 48 threads at 184k->187k rps.
src/stick_table.c