Skip to contentSkip to conversation

cpu/SMT: Fix cpu_smt_possible() comment

PATCH Applied Zhang Rui 2 participants 2 messages Jul 28, 2023 – Jul 31, 2023 CPU hotplug

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH v2 1/1 cpu/SMT: Fix cpu_smt_possible() comment

Commit e1572f1d08be ("cpu/SMT: create and export cpu_smt_possible()") introduces cpu_smt_possible() to represent if SMT is theoretically possible. It returns true when SMT is supported and not forcefully disabled ('nosmt=force'). But the comment of it says "Returns true if SMT is not supported of forcefully (irreversibly) disabled", which is wrong. Fix that comment accordingly.

---
Changes since V1
- rephrase the changelog

---
 kernel/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cpu.c +1 -1
index 88a7ede322bd..050dda751fc3 100644
@@ -642,7 +642,7 @@ static inline bool cpu_smt_allowed(unsigned int cpu)
 	return !cpumask_test_cpu(cpu, &cpus_booted_once_mask);
 }
 
-/* Returns true if SMT is not supported of forcefully (irreversibly) disabled */
+/* Returns true if SMT is supported and not forcefully (irreversibly) disabled */
 bool cpu_smt_possible(void)
 {
 	return cpu_smt_control != CPU_SMT_FORCE_DISABLED &&
Signature · 1 line
2.34.1
merge bot Applied
#1 lore raw
The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     52b38b7ad589c89a8c69272497bed20034f8e322
Gitweb:        https://git.kernel.org/tip/52b38b7ad589c89a8c69272497bed20034f8e322
Author:        Zhang Rui <[email protected]>
AuthorDate:    Fri, 28 Jul 2023 23:53:13 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 31 Jul 2023 17:32:44 +02:00

cpu/SMT: Fix cpu_smt_possible() comment

Commit e1572f1d08be ("cpu/SMT: create and export cpu_smt_possible()") introduces cpu_smt_possible() to represent if SMT is theoretically possible. It returns true when SMT is supported and not forcefully disabled ('nosmt=force'). But the comment of it says "Returns true if SMT is not supported of forcefully (irreversibly) disabled", which is wrong. Fix that comment accordingly.

---
 kernel/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cpu.c +1 -1
index 7e8f1b0..f6811c8 100644
@@ -676,7 +676,7 @@ static inline bool cpu_smt_allowed(unsigned int cpu)
 	return !cpumask_test_cpu(cpu, &cpus_booted_once_mask);
 }
 
-/* Returns true if SMT is not supported of forcefully (irreversibly) disabled */
+/* Returns true if SMT is supported and not forcefully (irreversibly) disabled */
 bool cpu_smt_possible(void)
 {
 	return cpu_smt_control != CPU_SMT_FORCE_DISABLED &&