MINOR: pools: evict excess objects using pool_evict_from_local_cache()
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 06:14:03 +0000 (08:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 13:24:33 +0000 (15:24 +0200)
commit87212036a1d63ea9cdd74fb5cb5234ad81bf0ddb
tree94224ff25a5bb7402112b38df40a87a05ea88e91
parent147e1fa38576188d4432fbb63b987010028ac986
MINOR: pools: evict excess objects using pool_evict_from_local_cache()

Till now we could only evict oldest objects from all local caches using
pool_evict_from_local_caches() until the cache size was satisfying again,
but there was no way to evict excess objects from a single cache, which
is the reason why pool_put_to_cache() used to refrain from putting into
the local cache and would directly write to the shared cache, resulting
in massive writes when caches were full.

Let's add this new function now. It will stop once the number of objects
in the local cache is no higher than 16+total/8 or the cache size is no
more than 75% full, just like before.

For now the function is not used.
src/pool.c