haproxy/doc/internals
Willy Tarreau f69fea64e0 MAJOR: fd: get rid of the DWCAS when setting the running_mask
Right now we're using a DWCAS to atomically set the running_mask while
being constrained by the thread_mask. This DWCAS is annoying because we
may seriously need it later when adding support for thread groups, for
checking that the running_mask applies to the correct group.

It turns out that the DWCAS is not strictly necessary because we never
need it to set the thread_mask based on the running_mask, only the other
way around. And in fact, the running_mask is always cleared alone, and
the thread_mask is changed alone as well. The running_mask is only
relevant to indicate a takeover when the thread_mask matches it. Any
bit set in running and not present in thread_mask indicates a transition
in progress.

As such, it is possible to re-arrange this by using a regular CAS around a
consistency check between running_mask and thread_mask in fd_update_events
and by making a CAS on running_mask then an atomic store on the thread_mask
in fd_takeover(). The only other case is fd_delete() but that one already
sets the running_mask before clearing the thread_mask, which is compatible
with the consistency check above.

This change has happily survived 10 billion takeovers on a 16-thread
machine at 800k requests/s.

The fd-migration doc was updated to reflect this change.
2021-08-04 16:03:36 +02:00
..
acl.txt
body-parsing.txt
buffer-api.txt CLEANUP: dynbuf: remove the unused b_alloc_fast() function 2021-03-22 16:28:05 +01:00
connect-status.txt
connection-header.txt
connection-scale.txt
entities-v2.txt
entities.fig
entities.pdf
entities.svg
entities.txt
fd-migration.txt MAJOR: fd: get rid of the DWCAS when setting the running_mask 2021-08-04 16:03:36 +02:00
filters.txt DOC: remove last occurrences of "HA-Proxy" syntax 2021-05-09 06:29:40 +02:00
hashing.txt [RELEASE] Released version 2.4-dev19 2021-05-10 07:50:26 +02:00
header-parser-speed.txt
header-tree.txt
http-cookies.txt
http-docs.txt
http-parsing.txt
htx-api.txt DOC: fix a few remainig cases of "Haproxy" and "HAproxy" in doc and comments 2021-05-09 06:50:46 +02:00
initcalls.txt
list.fig [RELEASE] Released version 2.4-dev17 2021-04-23 19:11:10 +02:00
list.png CLEANUP: lists/tree-wide: rename some list operations to avoid some confusion 2021-04-21 09:20:17 +02:00
listener-states.fig
listener-states.png
lua_socket.fig
lua_socket.pdf
muxes.fig [RELEASE] Released version 2.4-dev10 2021-02-26 22:49:10 +01:00
muxes.pdf DOC: muxes: add a diagram of the exchanges between muxes and outer world 2021-02-24 09:13:00 +01:00
muxes.png DOC: muxes: add a diagram of the exchanges between muxes and outer world 2021-02-24 09:13:00 +01:00
muxes.svg DOC: muxes: add a diagram of the exchanges between muxes and outer world 2021-02-24 09:13:00 +01:00
naming.txt
notes-layers.txt
pattern.dia
pattern.pdf
polling-states.fig
repartition-be-fe-fi.txt
sched.fig [RELEASE] Released version 2.4-dev10 2021-02-26 22:49:10 +01:00
sched.pdf DOC: scheduler: add a diagram showing the different queues and their usages 2021-02-26 17:49:37 +01:00
sched.png DOC: scheduler: add a diagram showing the different queues and their usages 2021-02-26 17:49:37 +01:00
sched.svg DOC: scheduler: add a diagram showing the different queues and their usages 2021-02-26 17:49:37 +01:00
sequence.fig
ssl_cert.dia DOC: internals: update the SSL architecture schema 2021-05-17 10:50:24 +02:00
stats-v2.txt
stream-sock-states.fig