]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cpuset: dynamically allocate cpu_map
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Jul 2023 09:35:32 +0000 (11:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Sep 2023 14:25:19 +0000 (16:25 +0200)
commit5119109e3feb25a1f9d5acbc14375047c0446f79
tree9b85af3adc95a34ae7e266bc23ea665a16f5841f
parentb0f20ed79b16180141a270435e8df7906d94b3eb
MINOR: cpuset: dynamically allocate cpu_map

cpu_map is 8.2kB/entry and there's one such entry per group, that's
~520kB total. In addition, the init code is still in haproxy.c enclosed
in ifdefs. Let's make this a dynamically allocated array in the cpuset
code and remove that init code.

Later we may even consider reallocating it once the number of threads
and groups is known, in order to shrink it a little bit, as the typical
setup with a single group will only need 8.2kB, thus saving half a MB
of RAM. This would require that the upper bound is placed in a variable
though.
include/haproxy/cpuset.h
src/cpuset.c
src/haproxy.c