]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: buffers: relax the buffer lock a little bit
authorWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 15:21:18 +0000 (17:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 15:25:21 +0000 (17:25 +0200)
commit186e96ece0fb5a657f18e3857f1b69fcff8ba6c3
treefba44597bb903d6991fd7158be963c27a776d05c
parenta8b2ce02b80928e1e1139671356d9661ef4be154
MEDIUM: buffers: relax the buffer lock a little bit

In lock profiles it's visible that there is a huge contention on the
buffer lock. The reason is that when offer_buffers() is called, it
systematically takes the lock before verifying if there is any
waiter. However doing so doesn't protect against races since a
waiter can happen just after we release the lock as well. Similarly
in h2 we take the lock every time an h2c is going to be released,
even without checking that the h2c belongs to a wait list. These
two have now been addressed by verifying non-emptiness of the list
prior to taking the lock.
include/common/buffer.h
src/mux_h2.c