From: Willy Tarreau Date: Mon, 21 Feb 2022 18:06:07 +0000 (+0100) Subject: CLEANUP: pools: remove the now unused pool_is_crowded() X-Git-Tag: v2.6-dev2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9de8a2b854871a9c273b123c48784ffe6a6e37aa;p=thirdparty%2Fhaproxy.git CLEANUP: pools: remove the now unused pool_is_crowded() This function was renderred obsolete by commit a0b5831ee ("MEDIUM: pools: centralize cache eviction in a common function") which replaced its last call inside the loop with a single call out of the loop to pool_releasable() as introduced by commit 91a8e28f9 ("MINOR: pool: add a function to estimate how many may be released at once"). Let's remove it before it becomes wrong and used again. --- diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h index 9aec880bc8..9f8658d54f 100644 --- a/include/haproxy/pool.h +++ b/include/haproxy/pool.h @@ -144,12 +144,6 @@ void pool_put_to_cache(struct pool_head *pool, void *ptr, const void *caller); #if defined(CONFIG_HAP_NO_GLOBAL_POOLS) -static inline int pool_is_crowded(const struct pool_head *pool) -{ - /* no shared pools, hence they're always full */ - return 1; -} - static inline uint pool_releasable(const struct pool_head *pool) { /* no room left */ @@ -171,13 +165,6 @@ static inline void pool_put_to_shared_cache(struct pool_head *pool, struct pool_ void pool_refill_local_from_shared(struct pool_head *pool, struct pool_cache_head *pch); void pool_put_to_shared_cache(struct pool_head *pool, struct pool_item *item, uint count); -/* returns true if the pool is considered to have too many free objects */ -static inline int pool_is_crowded(const struct pool_head *pool) -{ - return pool->allocated >= swrate_avg(pool->needed_avg + pool->needed_avg / 4, POOL_AVG_SAMPLES) && - (int)(pool->allocated - pool->used) >= pool->minavail; -} - /* Returns the max number of entries that may be brought back to the pool * before it's considered as full. Note that it is only usable for releasing * objects, hence the function assumes that no more than ->used entries will