extern struct pool_head pool_base_start[MAX_BASE_POOLS];
extern unsigned int pool_base_count;
extern struct pool_cache_head pool_cache[][MAX_BASE_POOLS];
-extern struct list pool_lru_head[MAX_THREADS];
extern THREAD_LOCAL size_t pool_cache_bytes; /* total cache size */
extern THREAD_LOCAL size_t pool_cache_count; /* #cache objects */
struct pool_cache_head *ph = &pool_cache[tid][idx];
LIST_ADD(&ph->list, &item->by_pool);
- LIST_ADD(&pool_lru_head[tid], &item->by_lru);
+ LIST_ADD(&ti->pool_lru_head, &item->by_lru);
ph->count++;
pool_cache_count++;
pool_cache_bytes += ph->size;
#include <time.h>
#include <haproxy/api-t.h>
+#include <haproxy/pool-t.h>
/* thread info flags, for ha_thread_info[].flags */
#define TI_FL_STUCK 0x00000001
uint64_t prev_mono_time; /* previous system wide monotonic time */
unsigned int idle_pct; /* idle to total ratio over last sample (percent) */
unsigned int flags; /* thread info flags, TI_FL_* */
+
+#ifdef CONFIG_HAP_LOCAL_POOLS
+ struct list pool_lru_head; /* oldest objects */
+#endif
/* pad to cache line (64B) */
char __pad[0]; /* unused except to check remaining room */
char __end[0] __attribute__((aligned(64)));
/* These ones are initialized per-thread on startup by init_pools() */
struct pool_cache_head pool_cache[MAX_THREADS][MAX_BASE_POOLS];
-struct list pool_lru_head[MAX_THREADS]; /* oldest objects */
THREAD_LOCAL size_t pool_cache_bytes = 0; /* total cache size */
THREAD_LOCAL size_t pool_cache_count = 0; /* #cache objects */
#endif
struct pool_cache_head *ph;
do {
- item = LIST_PREV(&pool_lru_head[tid], struct pool_cache_item *, by_lru);
+ item = LIST_PREV(&ti->pool_lru_head, struct pool_cache_item *, by_lru);
/* note: by definition we remove oldest objects so they also are the
* oldest in their own pools, thus their next is the pool's head.
*/
LIST_INIT(&pool_cache[thr][idx].list);
pool_cache[thr][idx].size = 0;
}
- LIST_INIT(&pool_lru_head[thr]);
+ LIST_INIT(&ha_thread_info[thr].pool_lru_head);
}
#endif
}