]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: memory: make pool_gc() run under thread isolation
authorWilly Tarreau <w@1wt.eu>
Fri, 24 Apr 2020 04:15:24 +0000 (06:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Apr 2020 04:25:25 +0000 (06:25 +0200)
commitc0e2ff202bda535aa60f3dc272ccf19a7b4f5094
tree704b51bdeafff7943454ba9ed6d793dc550f16cb
parent95fb57b92331c211f69af333cf5e043284ffbf25
MEDIUM: memory: make pool_gc() run under thread isolation

pool_gc() causes quite some stress on the memory allocator because
it calls a lot of free() calls while other threads are using malloc().
In addition, pool_gc() needs to take care of possible locking because
it may be called from pool allocators. One way to avoid all this is to
use thread_isolate() to make sure the gc runs alone. By putting less
pressure on the pools and getting rid of the locks, it may even take
less time to complete.
src/memory.c