]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cpu-topo: assign clusters to cores without and renumber them
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Jan 2025 17:20:53 +0000 (18:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:31 +0000 (18:30 +0100)
commitaf648c7b58a22bace702523054a1d1111e2c78e7
tree03d4463364be4c14d8b4ccd7c6534c885e888d48
parent385360fe8144462a12d4c69c49ca8d2c1232c282
MINOR: cpu-topo: assign clusters to cores without and renumber them

Due to the previous commit we can end up with cores not assigned
any cluster ID. For this, at the end we sort the CPUs by topology
and assign cluster IDs to remaining CPUs based on pkg/node/llc.
For example an 14900 now shows 5 clusters, one for the 8 p-cores,
and 4 of 4 e-cores each.

The local cluster numbers are per (node,pkg) ID so that any rule could
easily be applied on them, but we also keep the global numbers that
will help with thread group assignment.

We still need to force to assign distinct cluster IDs to cores
running on a different L3. For example the EPYC 74F3 is reported
as having 8 different L3s (which is true) and only one cluster.

Here we introduce a new function "cpu_compose_clusters()" that is called
from the main init code just after cpu_detect_topology() so that it's
not OS-dependent. It deals with this renumbering of all clusters in
topology order, taking care of considering any distinct LLC as being
on a distinct cluster.
include/haproxy/cpu_topo.h
src/cpu_topo.c
src/haproxy.c