MINOR: freq_ctr: add cpu_relax in the rotation loop of update_freq_ctr_period()
When counters are rotated, there is contention between the threads which
can slow down the operation of the thread performing the rotation. Let's
apply a cpu_relax there to let the first thread finish faster.
diff --git a/include/haproxy/freq_ctr.h b/include/haproxy/freq_ctr.h
index 9c10038..6b0cebf 100644
--- a/include/haproxy/freq_ctr.h
+++ b/include/haproxy/freq_ctr.h
@@ -50,7 +50,7 @@
/* remove the bit, used for the lock */
curr_tick &= ~1;
- } while (!_HA_ATOMIC_CAS(&ctr->curr_tick, &curr_tick, curr_tick | 0x1));
+ } while (!_HA_ATOMIC_CAS(&ctr->curr_tick, &curr_tick, curr_tick | 0x1) && __ha_cpu_relax());
__ha_barrier_atomic_store();
if (now_ms_tmp - curr_tick >= period) {