mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: pools: make pool_evict_last_items() use pool_put_to_os_no_dec()
The bucket is already known, no need to calculate it again. Let's just include the lower level functions.
This commit is contained in:
parent
7bf829ace1
commit
29eed99b50
14
src/pool.c
14
src/pool.c
@ -512,6 +512,7 @@ static void pool_evict_last_items(struct pool_head *pool, struct pool_cache_head
|
||||
uint released = 0;
|
||||
uint cluster = 0;
|
||||
uint to_free_max;
|
||||
uint bucket;
|
||||
|
||||
BUG_ON(pool_debugging & POOL_DBG_NO_CACHE);
|
||||
|
||||
@ -526,12 +527,12 @@ static void pool_evict_last_items(struct pool_head *pool, struct pool_cache_head
|
||||
LIST_DELETE(&item->by_pool);
|
||||
LIST_DELETE(&item->by_lru);
|
||||
|
||||
if (to_free_max > released || cluster) {
|
||||
/* will never match when global pools are disabled */
|
||||
uint bucket = pool_pbucket(item);
|
||||
bucket = pool_pbucket(item);
|
||||
_HA_ATOMIC_DEC(&pool->buckets[bucket].used);
|
||||
swrate_add_opportunistic(&pool->buckets[bucket].needed_avg, POOL_AVG_SAMPLES, pool->buckets[bucket].used);
|
||||
|
||||
if (to_free_max > released || cluster) {
|
||||
/* will never match when global pools are disabled */
|
||||
pi = (struct pool_item *)item;
|
||||
pi->next = NULL;
|
||||
pi->down = head;
|
||||
@ -543,8 +544,11 @@ static void pool_evict_last_items(struct pool_head *pool, struct pool_cache_head
|
||||
cluster = 0;
|
||||
head = NULL;
|
||||
}
|
||||
} else
|
||||
pool_free_nocache(pool, item);
|
||||
} else {
|
||||
/* does pool_free_nocache() with a known bucket */
|
||||
_HA_ATOMIC_DEC(&pool->buckets[bucket].allocated);
|
||||
pool_put_to_os_nodec(pool, item);
|
||||
}
|
||||
|
||||
released++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user