pool_flush() could become a source of contention on the pool's free list
if there are many competing thread using that pool. Let's make sure we
use EBO and not just a simple CPU relaxation there, to avoid disturbing
them.
for (bucket = 0; bucket < CONFIG_HAP_POOL_BUCKETS; bucket++) {
next = pool->buckets[bucket].free_list;
do {
- while (unlikely(next == POOL_BUSY)) {
- __ha_cpu_relax();
- next = _HA_ATOMIC_LOAD(&pool->buckets[bucket].free_list);
- }
+ while (unlikely(next == POOL_BUSY))
+ next = (void*)pl_wait_new_long((ulong*)&pool->buckets[bucket].free_list, (ulong)next);
+
if (next == NULL)
break;
} while (unlikely((next = _HA_ATOMIC_XCHG(&pool->buckets[bucket].free_list, POOL_BUSY)) == POOL_BUSY));