Commit 8078f4d6 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/cpu/topology: Rename smp_num_siblings



It's really a non-intuitive name. Rename it to __max_threads_per_core which
is obvious.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarMichael Kelley <mhklinux@outlook.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20240213210253.011307973@linutronix.de



parent 3205c983
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static inline u64 p4_clear_ht_bit(u64 config)
static inline int p4_ht_active(void)
{
#ifdef CONFIG_SMP
	return smp_num_siblings > 1;
	return __max_threads_per_core > 1;
#endif
	return 0;
}
@@ -189,7 +189,7 @@ static inline int p4_ht_active(void)
static inline int p4_ht_thread(int cpu)
{
#ifdef CONFIG_SMP
	if (smp_num_siblings == 2)
	if (__max_threads_per_core == 2)
		return cpu != cpumask_first(this_cpu_cpumask_var_ptr(cpu_sibling_map));
#endif
	return 0;
+0 −2
Original line number Diff line number Diff line
@@ -8,8 +8,6 @@
#include <asm/current.h>
#include <asm/thread_info.h>

extern unsigned int smp_num_siblings;

DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map);
DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map);
DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_die_map);
+1 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu);

extern unsigned int __max_dies_per_package;
extern unsigned int __max_logical_packages;
extern unsigned int __max_threads_per_core;

static inline unsigned int topology_max_packages(void)
{
+3 −3
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@
u32 elf_hwcap2 __read_mostly;

/* Number of siblings per CPU package */
unsigned int smp_num_siblings __ro_after_init = 1;
EXPORT_SYMBOL(smp_num_siblings);
unsigned int __max_threads_per_core __ro_after_init = 1;
EXPORT_SYMBOL(__max_threads_per_core);

unsigned int __max_dies_per_package __ro_after_init = 1;
EXPORT_SYMBOL(__max_dies_per_package);
@@ -2251,7 +2251,7 @@ void __init arch_cpu_finalize_init(void)
	 * identify_boot_cpu() initialized SMT support information, let the
	 * core code know.
	 */
	cpu_smt_set_num_threads(smp_num_siblings, smp_num_siblings);
	cpu_smt_set_num_threads(__max_threads_per_core, __max_threads_per_core);

	if (!IS_ENABLED(CONFIG_SMP)) {
		pr_info("CPU: ");
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ static int cpu_debug_show(struct seq_file *m, void *p)
	seq_printf(m, "amd_nodes_per_pkg:   %u\n", topology_amd_nodes_per_pkg());
	seq_printf(m, "max_cores:           %u\n", c->x86_max_cores);
	seq_printf(m, "max_dies_per_pkg:    %u\n", __max_dies_per_package);
	seq_printf(m, "smp_num_siblings:    %u\n", smp_num_siblings);
	seq_printf(m, "max_threads_per_core:%u\n", __max_threads_per_core);
	return 0;
}

Loading