diff --git a/src/cpu_topo.c b/src/cpu_topo.c index 3b1d29b8d..8d47fd01f 100644 --- a/src/cpu_topo.c +++ b/src/cpu_topo.c @@ -88,6 +88,19 @@ 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 < cpu_topo_maxcpus; cpu++) { + if (!ha_cpuset_isset(&boot_set, cpu)) + ha_cpu_topo[cpu].st |= HA_CPU_F_OFFLINE; + else + cpu_topo_lastcpu = cpu; + } + } + return 0; }