]> git.kaiwu.me - haproxy.git/commit
OPTIM: fd: Make each thread group's FD table NUMA-local
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 30 Jul 2026 17:42:17 +0000 (19:42 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 21 Oct 2026 13:13:20 +0000 (15:13 +0200)
commit4312f13a2d41e8dbb3e98c589ba5d2c86958b282
treed206745e2fb4e614233121b98f1193397304746a
parent32003c9a913cbad590d3fc4471a520bd90231f8c
OPTIM: fd: Make each thread group's FD table NUMA-local

With per-thread-group FD tables, the tables are allocated and zeroed,
hence faulted in, by the main thread, and the kernel's first-touch
placement then places every group's table on the main thread's NUMA
node, making the other groups' fdtab accesses, including the atomics
done for every FD event, run on remote memory.

Allocate the tables with mmap() instead, so that their pages are only
faulted in when they are first written, and make these first writes
come from the right CPUs: the boot thread is bound to group 0's CPUs
before any FD is inserted, and to each other group's CPUs around that
group's copy of the boot table, so that every table stays local to its
own node. Each group's slice is padded to the kernel's page size so
that no page is shared between two groups. Only matters with
per-group FD tables.
src/fd.c
src/thread.c