]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: streams: do not use the streams lock anymore
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 12:46:12 +0000 (13:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 12:54:50 +0000 (13:54 +0100)
commit49de68520e9dae3817885397373151aee4901c1b
tree8253f49c43f9137bbb371a97d50daecbb5ac2bf8
parenta698eb6739b502d957da773e121ef40833f818dc
MEDIUM: streams: do not use the streams lock anymore

The lock was still used exclusively to deal with the concurrency between
the "show sess" release handler and a stream_new() or stream_free() on
another thread. All other accesses made by "show sess" are already done
under thread isolation. The release handler only requires to unlink its
node when stopping in the middle of a dump (error, timeout etc). Let's
just isolate the thread to deal with this case so that it's compatible
with the dump conditions, and remove all remaining locking on the streams.

This effectively kills the streams lock. The measured gain here is around
1.6% with 4 threads (374krps -> 380k).
include/haproxy/thread.h
include/haproxy/tinfo-t.h
src/stream.c