]> git.kaiwu.me - haproxy.git/commit
MINOR: pool: check for pool's fullness outside of pool_put_to_shared_cache()
authorWilly Tarreau <w@1wt.eu>
Thu, 30 Dec 2021 16:37:33 +0000 (17:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Jan 2022 18:35:26 +0000 (19:35 +0100)
commitb46674a2839950769113c298d880ed01ca12339a
tree594d106c640394490052a0deece140562f397eea
parenta06f78b37698151f5106d8755230d3fc8c47bd09
MINOR: pool: check for pool's fullness outside of pool_put_to_shared_cache()

Instead of letting pool_put_to_shared_cache() pass the object to the
underlying OS layer when there's no more room, let's have the caller
check if the pool is full and either call pool_put_to_shared_cache()
or call pool_free_nocache().

Doing this sensibly simplifies the code as this function now only has
to deal with a pool and an item and only for cases where there are
local caches and shared caches. As the code was simplified and the
calls more isolated, the function was moved to pool.c.

Note that it's only called from pool_evict_from_local_cache{,s}() and
that a part of its logic might very well move there when dealing with
batches.
include/haproxy/pool.h
src/pool.c