mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-04 19:19:33 +00:00
3e853ea74d
The malloc and free calls and especially the underlying mmap/munmap() can occasionally take a huge amount of time and even cause the thread to sleep. This is visible when haproxy is compiled with DEBUG_UAF which causes every single pool allocation/free to allocate and release pages. In this case, when using the locked pools, the watchdog can occasionally fire under high contention (typically requesting 40000 1M objects in parallel over 8 threads). Then, "perf top" shows that 50% of the CPU time is spent in mmap() and munmap(). The reason the watchdog fires is because some threads spin on the pool lock which is held by other threads waiting on mmap() or munmap(). This patch modifies this so that the pool lock is released during these syscalls. Not only this allows other threads to request try to allocate their data in parallel, but it also considerably reduces the lock contention. Note that the locked pools are only used on small architectures where high thread counts would not make sense, so this will not provide any benefit in the general case. However it makes the debugging versions way more stable, which is always appreciated. |
||
---|---|---|
.. | ||
accept4.h | ||
base64.h | ||
buf.h | ||
buffer.h | ||
cfgparse.h | ||
chunk.h | ||
compat.h | ||
compiler.h | ||
config.h | ||
debug.h | ||
defaults.h | ||
epoll.h | ||
errors.h | ||
h1.h | ||
h2.h | ||
hash.h | ||
hathreads.h | ||
hpack-dec.h | ||
hpack-enc.h | ||
hpack-huff.h | ||
hpack-tbl.h | ||
http-hdr.h | ||
http.h | ||
htx.h | ||
initcall.h | ||
ist.h | ||
istbuf.h | ||
memory.h | ||
mini-clist.h | ||
namespace.h | ||
net_helper.h | ||
openssl-compat.h | ||
regex.h | ||
splice.h | ||
standard.h | ||
syscall.h | ||
template.h | ||
ticks.h | ||
time.h | ||
tools.h | ||
uri_auth.h | ||
version.h | ||
xref.h |