diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index d4d202b2f..8daf2adcc 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -286,6 +286,12 @@ static inline void stream_inc_http_fail_ctr(struct stream *s) static inline void stream_add_srv_conn(struct stream *sess, struct server *srv) { + /* note: this inserts in reverse order but we do not care, it's only + * used for massive kills (i.e. almost never). MT_LIST_ADD() is a bit + * faster than MT_LIST_ADDQ under contention due to a faster recovery + * from a conflict with an adjacent MT_LIST_DEL, and using it improves + * the performance by about 3% on 32-cores. + */ MT_LIST_ADD(&srv->actconns, &sess->by_srv); HA_ATOMIC_STORE(&sess->srv_conn, srv); }