]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cpu-topo: skip identification of non-existing CPUs
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jan 2025 18:50:36 +0000 (19:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:31 +0000 (18:30 +0100)
There's no point trying to read all entries under /cpu/cpu%d when that
one does not exist, so let's just skip it in this case.

src/cpu_topo.c

index 44814409ef36e217bfed28b31141d2e10da4537c..aebdcf8840dd3fbc27fe909e80e5e9e26e1d69d6 100644 (file)
@@ -272,6 +272,9 @@ int cpu_detect_topology(void)
                if (ha_cpu_topo[cpu].st & HA_CPU_F_OFFLINE)
                        continue;
 
+               if (!is_dir_present(NUMA_DETECT_SYSTEM_SYSFS_PATH "/cpu/cpu%d", cpu))
+                       continue;
+
                /* First, let's check the cache hierarchy. On systems exposing
                 * it, index0 generally is the L1D cache, index1 the L1I, index2
                 * the L2 and index3 the L3. But sometimes L1I/D are reversed,