MEDIUM: ring: unlock the ring's tail earlier
authorWilly Tarreau <w@1wt.eu>
Wed, 28 Feb 2024 08:57:00 +0000 (09:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commit41d3ea521bfdac6734fdbb6c237ef15946691a7c
tree01050295eb8ec143fbeaf3dc0b153769cd1b0dad
parent3cdd3d27a8721ecb129a12e939d6f50b4b98ca73
MEDIUM: ring: unlock the ring's tail earlier

We know we can continue to protect the message area so we can unlock the
tail as soon as we know its new value. Now we're seeing ~6.4M msg/s vs
5.4M previously on 3C6T of a 3rd gen EPYC, and 1.88M vs 1.54M for 24C48T
threads, which is a significant gain!

This requires to carefully write the new head counter before releasing
the writers, and to change the calculation of the work area from
tail..head to tail...new_tail while writing the message.
src/ring.c