CLEANUP: quic: no need for atomics on packet refcnt
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Feb 2023 14:37:24 +0000 (15:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Feb 2023 12:39:20 +0000 (13:39 +0100)
commit1ea5f410fff44170ea4be5c74c5ab1ff45209a52
treeb412024afdd1bf87a6ed120675bcdf7389521af7
parent23aa79d9a94f3fd725e5a0c95251ae5cfeeda531
CLEANUP: quic: no need for atomics on packet refcnt

This is a leftover from the implementation's history, but the
quic_rx_packet and quic_tx_packet ref counts were still atomically
updated. It was found in perf top that the cost of the atomic inc
in quic_tx_packet_refinc() alone was responsible for 1% of the CPU
usage at 135 Gbps. Given that packets are only processed on their
assigned thread we don't need that anymore and this can be replaced
with regular non-atomic operations.

Doing this alone has reduced the CPU usage of qc_do_build_pkt()
from 3.6 to 2.5% and increased the overall bit rate by about 1%.
include/haproxy/quic_conn.h