mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-26 21:31:01 +01:00
Let's switch memory accounting to atomics so that the allocator function may safely be used from concurrent Lua states. Given that this function is extremely hot on the call path, we try to optimize it for the most common case, which is: - no limit - there's enough memory The accounting is what is particuarly expensive in threads since all CPUs compete for a cache line, so when the limit is not used, we don't want to use accounting. However we need to preserve it during the boot phase until we may parse a "tune.lua.maxmem" value. For this, we turn the unlimited "0" value to ~0 at the end of the boot phase to mark the definite end of accounting. The function then detects this value and directly jumps to realloc() in this case. When the limit is enforced however, we use a CAS to check and reserve our share of memory, and we roll back on failure. The CAS is used both for increments and decrements so that a single operation is enough to update the counters.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
C
98%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.2%