haproxy/include
Willy Tarreau 0d6c75d749 OPTIM: freq-ctr: don't take the date lock for most updates
It's amazing that the value was still incremented under the date lock,
let's first use an atomic increment for the counter and move it out of
the date lock to reduce contention. These are just counters, we don't
need to take locks if we're not rotating, atomic ops are enough. This
patch does this, and leaves the lock for when the period is over. It's
important to note that some values might be added just before or just
after a rotation but this is not a problem since we don't care if a
value is counted in the previous or next period when it's exactly on
the edge. Great care was taken to ensure that the current counter is
always atomically updated.

Other minor cleanups were performed, such as avoiding to reload the
value from memory after a CAS, or using &~1 instead of two shifts to
remove the lowest bit.
2019-05-25 20:31:53 +02:00
..
common BUILD: signals: FreeBSD has SI_LWP instead of SI_TKILL 2019-05-23 08:40:50 +02:00
import BUILD: threads/plock: fix a build issue on Clang without optimization 2017-11-20 21:06:35 +01:00
proto OPTIM: freq-ctr: don't take the date lock for most updates 2019-05-25 20:31:53 +02:00
types MINOR: raw_sock: report global traffic statistics 2019-05-23 11:45:38 +02:00