haproxy/doc/internals/api
Willy Tarreau c618ed5ff4 MAJOR: import: update mt_list to support exponential back-off
The new mt_list code supports exponential back-off on conflict, which
is important for use cases where there is contention on a large number
of threads. The API evolved a little bit and required some updates:

  - mt_list_for_each_entry_safe() is now in upper case to explicitly
    show that it is a macro, and only uses the back element, doesn't
    require a secondary pointer for deletes anymore.

  - MT_LIST_DELETE_SAFE() doesn't exist anymore, instead one just has
    to set the list iterator to NULL so that it is not re-inserted
    into the list and the list is spliced there. One must be careful
    because it was usually performed before freeing the element. Now
    instead the element must be nulled before the continue/break.

  - MT_LIST_LOCK_ELT() and MT_LIST_UNLOCK_ELT() have always been
    unclear. They were replaced by mt_list_cut_around() and
    mt_list_connect_elem() which more explicitly detach the element
    and reconnect it into the list.

  - MT_LIST_APPEND_LOCKED() was only in haproxy so it was left as-is
    in list.h. It may however possibly benefit from being upstreamed.

This required tiny adaptations to event_hdl.c and quic_sock.c. The
test case was updated and the API doc added. Note that in order to
keep include files small, the struct mt_list definition remains in
list-t.h (par of the internal API) and was ifdef'd out in mt_list.h.

A test on QUIC with both quictls 1.1.1 and wolfssl 5.6.3 on ARM64 with
80 threads shows a drastic reduction of CPU usage thanks to this and
the refined memory barriers. Please note that the CPU usage on OpenSSL
3.0.9 is significantly higher due to the excessive use of atomic ops
by openssl, but 3.1 is only slightly above 1.1.1 though:

  - before: 35 Gbps, 3.5 Mpps, 7800% CPU
  - after:  41 Gbps, 4.2 Mpps, 2900% CPU
2023-09-13 11:50:33 +02:00
..
appctx.txt CLEANUP: assorted typo fixes in the code and comments 2022-08-06 17:12:51 +02:00
buffer-api.txt
event_hdl.txt [RELEASE] Released version 2.8-dev7 2023-04-08 17:38:39 +02:00
filters.txt
htx-api.txt CLEANUP: assorted typo fixes in the code and comments 2022-10-30 17:17:56 +01:00
initcalls.txt MEDIUM: init: initialize the trash earlier 2023-09-08 16:25:19 +02:00
ist.txt
layers.txt DOC: internal: add a description of the stream connectors and descriptors 2022-05-27 19:34:36 +02:00
list.txt
mt_list.txt MAJOR: import: update mt_list to support exponential back-off 2023-09-13 11:50:33 +02:00
pools.txt BUG/MINOR: pool/stats: Use ullong to report total pool usage in bytes in stats 2022-12-22 13:46:21 +01:00
scheduler.txt MINOR: task: replace task_set_affinity() with task_set_thread() 2022-07-01 19:15:14 +02:00