Skip to contentSkip to conversation

Revert "intel_idle: Rescan "dead" SMT siblings during, initialization"

PATCH In review Christian Loehle 2 participants 6 messages Aug 28, 2025 – Aug 29, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "intel_idle: Rescan "dead" SMT siblings during, initialization"

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:
cpu online capacity
cpu0 1 1009
cpu1 0 -
cpu2 1 1009
cpu3 0 -
cpu4 1 1009
cpu5 0 -
cpu6 1 1009
cpu7 0 -
cpu8 1 1024
cpu9 0 -
cpu10 1 1024
cpu11 0 -
cpu12 1 1009
cpu13 0 -
cpu14 1 1009
cpu15 0 -
cpu16 1 623
cpu17 1 623
cpu18 1 623
cpu19 1 623
cpu20 0 -
cpu21 0 -
cpu22 0 -
cpu23 0 -

Previously:
cpu online capacity
cpu0 1 1009
cpu1 0 -
cpu2 1 1009
cpu3 0 -
cpu4 1 1009
cpu5 0 -
cpu6 1 1009
cpu7 0 -
cpu8 1 1024
cpu9 0 -
cpu10 1 1024
cpu11 0 -
cpu12 1 1009
cpu13 0 -
cpu14 1 1009
cpu15 0 -
cpu16 1 623
cpu17 1 623
cpu18 1 623
cpu19 1 623
cpu20 1 623
cpu21 1 623
cpu22 1 623
cpu23 1 623

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

 drivers/idle/intel_idle.c | 2 --
 1 file changed, 2 deletions(-)
drivers/idle/intel_idle.c +0 -2
index 91a7b7e7c0c8..a9c58395a425 100644
@@ -2507,8 +2507,6 @@ static int __init intel_idle_init(void)
 	pr_debug("Local APIC timer is reliable in %s\n",
 		 boot_cpu_has(X86_FEATURE_ARAT) ? "all C-states" : "C1");
 
-	arch_cpu_rescan_dead_smt_siblings();
-
 	return 0;
 
 hp_setup_fail:
Signature · 1 line
2.34.1
#1 lore raw
Quoted 61 lines · Christian Loehle

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   0       -
cpu21   0       -
cpu22   0       -
cpu23   0       -

Previously:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   1       623
cpu21   1       623
cpu22   1       623
cpu23   1       623
Quoted 4 lines

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

Sure, thanks for reporting this!

Well, I think that cpuhp_smt_enable() is missing a check. It looks to me like it should do the topology_is_primary_thread(cpu) check like cpuhp_smt_disable().

I'll cut a test patch for this later.

Quoted 17 lines
 drivers/idle/intel_idle.c | 2 --
 1 file changed, 2 deletions(-)
drivers/idle/intel_idle.c +0 -3
index 91a7b7e7c0c8..a9c58395a425 100644
@@ -2507,8 +2507,6 @@ static int __init intel_idle_init(void)
        pr_debug("Local APIC timer is reliable in %s\n",
                 boot_cpu_has(X86_FEATURE_ARAT) ? "all C-states" : "C1");
 
-       arch_cpu_rescan_dead_smt_siblings();
-
        return 0;
 
 hp_setup_fail:
--
#2 lore raw
Quoted 69 lines · Rafael J. Wysocki
Quoted 61 lines · Christian Loehle

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   0       -
cpu21   0       -
cpu22   0       -
cpu23   0       -

Previously:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   1       623
cpu21   1       623
cpu22   1       623
cpu23   1       623
Quoted 4 lines

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

Quoted 7 lines

Sure, thanks for reporting this!

Well, I think that cpuhp_smt_enable() is missing a check. It looks to me like it should do the topology_is_primary_thread(cpu) check like cpuhp_smt_disable().

I'll cut a test patch for this later.

Something like the attached one, perhaps. I haven't tested it yet, but I'll do that later.

---
 kernel/cpu.c |    7 +++++++
 1 file changed, 7 insertions(+)
kernel/cpu.c +7 -0
@@ -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;
#3 lore raw
Quoted 73 lines · Rafael J. Wysocki
Quoted 71 lines · Rafael J. Wysocki
Quoted 61 lines · Christian Loehle

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   0       -
cpu21   0       -
cpu22   0       -
cpu23   0       -

Previously:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   1       623
cpu21   1       623
cpu22   1       623
cpu23   1       623
Quoted 4 lines

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

Sure, thanks for reporting this!

Quoted 8 lines
Quoted 5 lines

Well, I think that cpuhp_smt_enable() is missing a check. It looks to me like it should do the topology_is_primary_thread(cpu) check like cpuhp_smt_disable().

I'll cut a test patch for this later.

Something like the attached one, perhaps. I haven't tested it yet, but I'll do that later.

Works here AFAICS, but my test system is not hybrid.

author Tested-by
#4 lore raw
Quoted 78 lines · Rafael J. Wysocki
Quoted 77 lines · Rafael J. Wysocki
Quoted 75 lines · Rafael J. Wysocki
Quoted 61 lines · Christian Loehle

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   0       -
cpu21   0       -
cpu22   0       -
cpu23   0       -

Previously:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   1       623
cpu21   1       623
cpu22   1       623
cpu23   1       623
Quoted 4 lines

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

Sure, thanks for reporting this!

Well, I think that cpuhp_smt_enable() is missing a check. It looks to me like it should do the topology_is_primary_thread(cpu) check like cpuhp_smt_disable().

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I'll cut a test patch for this later.

Something like the attached one, perhaps. I haven't tested it yet, but I'll do that later.

Works here AFAICS, but my test system is not hybrid.

Yep, on my end as well, thanks!

#5 lore raw
Quoted 82 lines · Christian Loehle
Quoted 80 lines · Rafael J. Wysocki
Quoted 79 lines · Rafael J. Wysocki
Quoted 76 lines · Rafael J. Wysocki
Quoted 61 lines · Christian Loehle

This reverts commit a430c11f401589a0f4f57fd398271a5d85142c7a.

Calling arch_cpu_rescan_dead_smt_siblings() in intel_idle_init with boot parameter nosmt and maxcpus active hotplugged boot-offline CPUs in (and leave them online) which weren't supposed to be online.

With the revert and nosmt and maxcpus=12 on a raptor lake:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   0       -
cpu21   0       -
cpu22   0       -
cpu23   0       -

Previously:

cpu     online  capacity
cpu0    1       1009
cpu1    0       -
cpu2    1       1009
cpu3    0       -
cpu4    1       1009
cpu5    0       -
cpu6    1       1009
cpu7    0       -
cpu8    1       1024
cpu9    0       -
cpu10   1       1024
cpu11   0       -
cpu12   1       1009
cpu13   0       -
cpu14   1       1009
cpu15   0       -
cpu16   1       623
cpu17   1       623
cpu18   1       623
cpu19   1       623
cpu20   1       623
cpu21   1       623
cpu22   1       623
cpu23   1       623
Quoted 4 lines

---
Rafael, I don't immediately see how to fix this properly so I won't try to, feel free to treat this as a bug report.

Sure, thanks for reporting this!

Well, I think that cpuhp_smt_enable() is missing a check. It looks to me like it should do the topology_is_primary_thread(cpu) check like cpuhp_smt_disable().

I'll cut a test patch for this later.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Something like the attached one, perhaps. I haven't tested it yet, but I'll do that later.

Works here AFAICS, but my test system is not hybrid.

Yep, on my end as well, thanks!

Thanks for testing and let me submit a proper patch.