Loading Documentation/ABI/testing/sysfs-devices-system-cpu +1 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,7 @@ Description: Control Symmetric Multi Threading (SMT) ================ ========================================= "on" SMT is enabled "off" SMT is disabled "<N>" SMT is enabled with N threads per core. "forceoff" SMT is force disabled. Cannot be changed. "notsupported" SMT is not supported by the CPU "notimplemented" SMT runtime toggling is not Loading arch/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ config ARCH_HAS_SUBPAGE_FAULTS config HOTPLUG_SMT bool config SMT_NUM_THREADS_DYNAMIC bool # Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL config HOTPLUG_CORE_SYNC bool Loading arch/x86/include/asm/topology.h +2 −2 Original line number Diff line number Diff line Loading @@ -136,10 +136,11 @@ static inline int topology_max_smt_threads(void) return __max_smt_threads; } #include <linux/cpu_smt.h> int topology_update_package_map(unsigned int apicid, unsigned int cpu); int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_phys_to_logical_pkg(unsigned int pkg); bool topology_smt_supported(void); extern struct cpumask __cpu_primary_thread_mask; #define cpu_primary_thread_mask ((const struct cpumask *)&__cpu_primary_thread_mask) Loading @@ -162,7 +163,6 @@ static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } static inline int topology_max_die_per_package(void) { return 1; } static inline int topology_max_smt_threads(void) { return 1; } static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } static inline bool topology_smt_supported(void) { return false; } #endif /* !CONFIG_SMP */ static inline void arch_fix_phys_package_id(int num, u32 slot) Loading arch/x86/kernel/cpu/common.c +1 −1 Original line number Diff line number Diff line Loading @@ -2317,7 +2317,7 @@ void __init arch_cpu_finalize_init(void) * identify_boot_cpu() initialized SMT support information, let the * core code know. */ cpu_smt_check_topology(); cpu_smt_set_num_threads(smp_num_siblings, smp_num_siblings); if (!IS_ENABLED(CONFIG_SMP)) { pr_info("CPU: "); Loading arch/x86/kernel/smpboot.c +0 −8 Original line number Diff line number Diff line Loading @@ -326,14 +326,6 @@ static void notrace start_secondary(void *unused) cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); } /** * topology_smt_supported - Check whether SMT is supported by the CPUs */ bool topology_smt_supported(void) { return smp_num_siblings > 1; } /** * topology_phys_to_logical_pkg - Map a physical package id to a logical * @phys_pkg: The physical package id to map Loading Loading
Documentation/ABI/testing/sysfs-devices-system-cpu +1 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,7 @@ Description: Control Symmetric Multi Threading (SMT) ================ ========================================= "on" SMT is enabled "off" SMT is disabled "<N>" SMT is enabled with N threads per core. "forceoff" SMT is force disabled. Cannot be changed. "notsupported" SMT is not supported by the CPU "notimplemented" SMT runtime toggling is not Loading
arch/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ config ARCH_HAS_SUBPAGE_FAULTS config HOTPLUG_SMT bool config SMT_NUM_THREADS_DYNAMIC bool # Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL config HOTPLUG_CORE_SYNC bool Loading
arch/x86/include/asm/topology.h +2 −2 Original line number Diff line number Diff line Loading @@ -136,10 +136,11 @@ static inline int topology_max_smt_threads(void) return __max_smt_threads; } #include <linux/cpu_smt.h> int topology_update_package_map(unsigned int apicid, unsigned int cpu); int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_phys_to_logical_pkg(unsigned int pkg); bool topology_smt_supported(void); extern struct cpumask __cpu_primary_thread_mask; #define cpu_primary_thread_mask ((const struct cpumask *)&__cpu_primary_thread_mask) Loading @@ -162,7 +163,6 @@ static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } static inline int topology_max_die_per_package(void) { return 1; } static inline int topology_max_smt_threads(void) { return 1; } static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } static inline bool topology_smt_supported(void) { return false; } #endif /* !CONFIG_SMP */ static inline void arch_fix_phys_package_id(int num, u32 slot) Loading
arch/x86/kernel/cpu/common.c +1 −1 Original line number Diff line number Diff line Loading @@ -2317,7 +2317,7 @@ void __init arch_cpu_finalize_init(void) * identify_boot_cpu() initialized SMT support information, let the * core code know. */ cpu_smt_check_topology(); cpu_smt_set_num_threads(smp_num_siblings, smp_num_siblings); if (!IS_ENABLED(CONFIG_SMP)) { pr_info("CPU: "); Loading
arch/x86/kernel/smpboot.c +0 −8 Original line number Diff line number Diff line Loading @@ -326,14 +326,6 @@ static void notrace start_secondary(void *unused) cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); } /** * topology_smt_supported - Check whether SMT is supported by the CPUs */ bool topology_smt_supported(void) { return smp_num_siblings > 1; } /** * topology_phys_to_logical_pkg - Map a physical package id to a logical * @phys_pkg: The physical package id to map Loading