]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: dynbuf: pass a criticality argument to b_alloc()
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Apr 2024 06:55:20 +0000 (08:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 May 2024 15:18:13 +0000 (17:18 +0200)
commit72d0dcda8e80b9a7d76a0468fa0a751ded20a7cb
tree31de5d8f29a54c731346b20e40e4f01ea6de04d3
parent84f7525c5b3831a76f17dacc8891aad27e1f4de5
MINOR: dynbuf: pass a criticality argument to b_alloc()

The goal is to indicate how critical the allocation is, between the
least one (growing an existing buffer ring) and the topmost one (boot
time allocation for the life of the process).

The 3 tcp-based muxes (h1, h2, fcgi) use a common allocation function
to try to allocate otherwise subscribe. There's currently no distinction
of direction nor part that tries to allocate, and this should be revisited
to improve this situation, particularly when we consider that mux-h2 can
reduce its Tx allocations if needed.

For now, 4 main levels are planned, to translate how the data travels
inside haproxy from a producer to a consumer:
  - MUX_RX:   buffer used to receive data from the OS
  - SE_RX:    buffer used to place a transformation of the RX data for
              a mux, or to produce a response for an applet
  - CHANNEL:  the channel buffer for sync recv
  - MUX_TX:   buffer used to transfer data from the channel to the outside,
              generally a mux but there can be a few specificities (e.g.
              http client's response buffer passed to the application,
              which also gets a transformation of the channel data).

The other levels are a bit different in that they don't strictly need to
allocate for the first two ones, or they're permanent for the last one
(used by compression).
23 files changed:
doc/internals/api/buffer-api.txt
include/haproxy/applet.h
include/haproxy/channel.h
include/haproxy/dynbuf-t.h
include/haproxy/dynbuf.h
include/haproxy/quic_conn.h
src/applet.c
src/check.c
src/compression.c
src/flt_http_comp.c
src/flt_spoe.c
src/h3.c
src/hq_interop.c
src/http_client.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_quic.c
src/quic_sock.c
src/quic_tx.c
src/ssl_sock.c
src/stconn.c
src/stream.c