mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-19 20:27:01 +00:00
MINOR: cpuset: try to detect offline cpus at boot
When possible, the offline CPUs are detected at boot and their OFFLINE flag is set in the ha_cpu_topo[] array. When the detection is not possible (e.g. not linux, /sys not mounted etc), we just mark none of them as being offline, as we don't want to infer wrong info that could hinder automatic CPU placement detection.
This commit is contained in:
parent
fb2311518f
commit
ef5d4ab8da
11
src/cpuset.c
11
src/cpuset.c
@ -249,6 +249,17 @@ int cpu_detect_usable(void)
|
||||
if (!ha_cpuset_isset(&boot_set, cpu))
|
||||
ha_cpu_topo[cpu].st |= HA_CPU_F_EXCLUDED;
|
||||
|
||||
/* Update the list of currently offline CPUs. Normally it's a subset
|
||||
* of the unbound ones, but we cannot infer anything if we don't have
|
||||
* the info so we only update what we know.
|
||||
*/
|
||||
if (ha_cpuset_detect_online(&boot_set)) {
|
||||
for (cpu = 0; cpu < maxcpus; cpu++) {
|
||||
if (!ha_cpuset_isset(&boot_set, cpu))
|
||||
ha_cpu_topo[cpu].st |= HA_CPU_F_OFFLINE;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user