--- kernel/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2710,6 +2710,13 @@ cpu_maps_update_begin(); cpu_smt_control = CPU_SMT_ENABLED; for_each_present_cpu(cpu) { + /* + * Avoid accidentally onlining primary thread CPUs that have + * been taken offline. + */ + if (topology_is_primary_thread(cpu)) + continue; + /* Skip online CPUs and CPUs on offline nodes */ if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) continue;