Skip to contentSkip to conversation

x86/speculation: Remove redundant arch_smt_update() call in sysfs SMT control

PATCH New Zhenzhong Duan 2 participants 2 messages Jan 17, 2019 – Jan 29, 2019 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/speculation: Remove redundant arch_smt_update() call in sysfs SMT control

With commit a74cfffb03b7 ("x86/speculation: Rework SMT state change"), arch_smt_update() is invoked from each individual CPU hotplug function. Then the extra arch_smt_update() call in the sysfs SMT control is redundant.

---
 kernel/cpu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/cpu.c +1 -4
index 91d5c38..c0c7f64 100644
@@ -2090,10 +2090,8 @@ static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
 		 */
 		cpuhp_offline_cpu_device(cpu);
 	}
-	if (!ret) {
+	if (!ret)
 		cpu_smt_control = ctrlval;
-		arch_smt_update();
-	}
 	cpu_maps_update_done();
 	return ret;
 }
@@ -2104,7 +2102,6 @@ static int cpuhp_smt_enable(void)
 
 	cpu_maps_update_begin();
 	cpu_smt_control = CPU_SMT_ENABLED;
-	arch_smt_update();
 	for_each_present_cpu(cpu) {
 		/* Skip online CPUs and CPUs on offline nodes */
 		if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
Signature · 1 line
1.8.3.1
#1 lore raw

[tip:smp/urgent] x86/speculation: Remove redundant arch_smt_update() invocation

x86/speculation: Remove redundant arch_smt_update() invocation
Commit-ID:  34d66caf251df91ff27b24a3a786810d29989eca
Gitweb:     https://git.kernel.org/tip/34d66caf251df91ff27b24a3a786810d29989eca
Author:     Zhenzhong Duan <[email protected]>
AuthorDate: Thu, 17 Jan 2019 02:10:59 -0800
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 29 Jan 2019 22:20:24 +0100

x86/speculation: Remove redundant arch_smt_update() invocation

With commit a74cfffb03b7 ("x86/speculation: Rework SMT state change"), arch_smt_update() is invoked from each individual CPU hotplug function.

Therefore the extra arch_smt_update() call in the sysfs SMT control is redundant.

---
 kernel/cpu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/cpu.c +1 -4
index 91d5c38eb7e5..c0c7f64573ed 100644
@@ -2090,10 +2090,8 @@ static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
 		 */
 		cpuhp_offline_cpu_device(cpu);
 	}
-	if (!ret) {
+	if (!ret)
 		cpu_smt_control = ctrlval;
-		arch_smt_update();
-	}
 	cpu_maps_update_done();
 	return ret;
 }
@@ -2104,7 +2102,6 @@ static int cpuhp_smt_enable(void)
 
 	cpu_maps_update_begin();
 	cpu_smt_control = CPU_SMT_ENABLED;
-	arch_smt_update();
 	for_each_present_cpu(cpu) {
 		/* Skip online CPUs and CPUs on offline nodes */
 		if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))