]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stick-tables: remove the uneeded read lock in stksess_free()
authorWilly Tarreau <w@1wt.eu>
Thu, 23 May 2024 18:31:45 +0000 (20:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 May 2024 09:52:57 +0000 (11:52 +0200)
commit0bda33a3ec0ad52e0d788f97d17859449fe870f9
tree1b311c3710a846c98f8bd7274c846a25cf9060ef
parent8580f9db20ffe070c577eec32d3316dd2f5027ab
MINOR: stick-tables: remove the uneeded read lock in stksess_free()

During changes made in 2.7 by commits 8d3c3336f9 ("MEDIUM: stick-table:
make stksess_kill_if_expired() avoid the exclusive lock") and 996f1a5124
("MEDIUM: stick-table: do not take a lock to update t->current anymore."),
the operation was done cautiously one baby step at a time and the final
cleanup was not done, as we're keeping a read lock under an atomic dec.
Furthermore there's a pool_free() call under that lock, and we try to
avoid pool_alloc() and pool_free() under locks for their nasty side
effects (e.g. when memory gets recompacted), so let's really drop it
now.

Note that the performance gain is not really perceptible here, it's
essentially for code clarity reasons that this has to be done.
src/stick_table.c