]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: pools: replace CONFIG_HAP_POOLS with a runtime "NO_CACHE" flag.
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Feb 2022 15:23:09 +0000 (16:23 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
commite981631d2737c5ded7db96ec2789e60c2787bdb7
treeee9e1b4febe83f93e5ebe83f0ab698ed4d407db4
parentdff3b0627d7d26b99411b8e302bbb03968060acf
MEDIUM: pools: replace CONFIG_HAP_POOLS with a runtime "NO_CACHE" flag.

Like previous patches, this replaces the build-time code paths that were
conditionned by CONFIG_HAP_POOLS with runtime paths conditionned by
!POOL_DBG_NO_CACHE. One trivial test had to be added in the hot path in
__pool_alloc() to refrain from calling pool_get_from_cache(), and another
one in __pool_free() to avoid calling pool_put_to_cache().

All cache-specific functions were instrumented with a BUG_ON() to make
sure we never call them with cache disabled. Additionally the cache[]
array was not initialized (remains NULL) so that we can later drop it
if not needed. It's particularly huge and should be turned to dynamic
with a pointer to a per-thread area where all the objects are located.
This will solve the memory usage issue and will improve locality, or
even help better deal with NUMA machines once each thread uses its own
arena.
include/haproxy/pool-t.h
include/haproxy/pool.h
include/haproxy/tinfo-t.h
src/pool.c