]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: pools: remove the now unused pool_is_crowded()
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Feb 2022 18:06:07 +0000 (19:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Feb 2022 19:44:26 +0000 (20:44 +0100)
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.

include/haproxy/pool.h

index 9aec880bc82f2107127f71d252e9c8d8b376edcd..9f8658d54fb4c6315cf850405dc13092365d69cf 100644 (file)
@@ -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