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, 1 May 2020 10:12:33 +0000 (12:12 +0200)
commit9e57387dfb7d11bdf4c95c7c7ffcd2f9059380c6
tree544314c2703994837ac1226daef2f913bb9aa33e
parent18f46732f6afa2477cd417167462a836b1a9ccda
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.

(cherry picked from commit c0e2ff202bda535aa60f3dc272ccf19a7b4f5094)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/memory.c