]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: memory: make local pools independent on lockless pools
authorWilly Tarreau <w@1wt.eu>
Mon, 1 Jun 2020 17:00:28 +0000 (19:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:57 +0000 (10:18 +0200)
commited891fda52edd23330dac528623484140c71533c
treea868ce102dd0aa1ac0111c2daf996165aa6a0e5c
parentf8c1b648c0504c08812e252535cda6d3c58db2ad
MEDIUM: memory: make local pools independent on lockless pools

Till now the local pool caches were implemented only when lockless pools
were in use. This was mainly due to the difficulties to disentangle the
code parts. However the locked pools would further benefit from the local
cache, and having this would reduce the variants in the code.

This patch does just this. It adds a new debug macro DEBUG_NO_LOCAL_POOLS
to forcefully disable local pool caches, and makes sure that the high
level functions are now strictly the same between locked and lockless
(pool_alloc(), pool_alloc_dirty(), pool_free(), pool_get_first()). The
pool index calculation was moved inside the CONFIG_HAP_LOCAL_POOLS guards.
This allowed to move them out of the giant #ifdef and to significantly
reduce the code duplication.

A quick perf test shows that with locked pools the performance increases
by roughly 10% on 8 threads and gets closer to the lockless one.
include/common/buffer.h
include/common/memory.h
include/haproxy/pool-t.h
src/memory.c