File tree Expand file tree Collapse file tree 9 files changed +13
-14
lines changed Expand file tree Collapse file tree 9 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -181,15 +181,15 @@ static inline u64 p4_clear_ht_bit(u64 config)
181
181
static inline int p4_ht_active (void )
182
182
{
183
183
#ifdef CONFIG_SMP
184
- return smp_num_siblings > 1 ;
184
+ return __max_threads_per_core > 1 ;
185
185
#endif
186
186
return 0 ;
187
187
}
188
188
189
189
static inline int p4_ht_thread (int cpu )
190
190
{
191
191
#ifdef CONFIG_SMP
192
- if (smp_num_siblings == 2 )
192
+ if (__max_threads_per_core == 2 )
193
193
return cpu != cpumask_first (this_cpu_cpumask_var_ptr (cpu_sibling_map ));
194
194
#endif
195
195
return 0 ;
Original file line number Diff line number Diff line change 8
8
#include <asm/current.h>
9
9
#include <asm/thread_info.h>
10
10
11
- extern unsigned int smp_num_siblings ;
12
-
13
11
DECLARE_PER_CPU_READ_MOSTLY (cpumask_var_t , cpu_sibling_map );
14
12
DECLARE_PER_CPU_READ_MOSTLY (cpumask_var_t , cpu_core_map );
15
13
DECLARE_PER_CPU_READ_MOSTLY (cpumask_var_t , cpu_die_map );
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu);
145
145
146
146
extern unsigned int __max_dies_per_package ;
147
147
extern unsigned int __max_logical_packages ;
148
+ extern unsigned int __max_threads_per_core ;
148
149
149
150
static inline unsigned int topology_max_packages (void )
150
151
{
Original file line number Diff line number Diff line change 73
73
u32 elf_hwcap2 __read_mostly ;
74
74
75
75
/* Number of siblings per CPU package */
76
- unsigned int smp_num_siblings __ro_after_init = 1 ;
77
- EXPORT_SYMBOL (smp_num_siblings );
76
+ unsigned int __max_threads_per_core __ro_after_init = 1 ;
77
+ EXPORT_SYMBOL (__max_threads_per_core );
78
78
79
79
unsigned int __max_dies_per_package __ro_after_init = 1 ;
80
80
EXPORT_SYMBOL (__max_dies_per_package );
@@ -2251,7 +2251,7 @@ void __init arch_cpu_finalize_init(void)
2251
2251
* identify_boot_cpu() initialized SMT support information, let the
2252
2252
* core code know.
2253
2253
*/
2254
- cpu_smt_set_num_threads (smp_num_siblings , smp_num_siblings );
2254
+ cpu_smt_set_num_threads (__max_threads_per_core , __max_threads_per_core );
2255
2255
2256
2256
if (!IS_ENABLED (CONFIG_SMP )) {
2257
2257
pr_info ("CPU: " );
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ static int cpu_debug_show(struct seq_file *m, void *p)
30
30
seq_printf (m , "amd_nodes_per_pkg: %u\n" , topology_amd_nodes_per_pkg ());
31
31
seq_printf (m , "max_cores: %u\n" , c -> x86_max_cores );
32
32
seq_printf (m , "max_dies_per_pkg: %u\n" , __max_dies_per_package );
33
- seq_printf (m , "smp_num_siblings: %u\n" , smp_num_siblings );
33
+ seq_printf (m , "max_threads_per_core: %u\n" , __max_threads_per_core );
34
34
return 0 ;
35
35
}
36
36
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ static u32 get_nbc_for_node(int node_id)
433
433
struct cpuinfo_x86 * c = & boot_cpu_data ;
434
434
u32 cores_per_node ;
435
435
436
- cores_per_node = (c -> x86_max_cores * smp_num_siblings ) / topology_amd_nodes_per_pkg ();
436
+ cores_per_node = (c -> x86_max_cores * __max_threads_per_core ) / topology_amd_nodes_per_pkg ();
437
437
return cores_per_node * node_id ;
438
438
}
439
439
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
76
76
#ifdef CONFIG_SMP
77
77
static void cpu_mark_primary_thread (unsigned int cpu , unsigned int apicid )
78
78
{
79
- if (!(apicid & (smp_num_siblings - 1 )))
79
+ if (!(apicid & (__max_threads_per_core - 1 )))
80
80
cpumask_set_cpu (cpu , & __cpu_primary_thread_mask );
81
81
}
82
82
#else
@@ -429,8 +429,8 @@ void __init topology_init_possible_cpus(void)
429
429
* Can't use order delta here as order(cnta) can be equal
430
430
* order(cntb) even if cnta != cntb.
431
431
*/
432
- smp_num_siblings = DIV_ROUND_UP (cntb , cnta );
433
- pr_info ("Max. threads per core: %3u\n" , smp_num_siblings );
432
+ __max_threads_per_core = DIV_ROUND_UP (cntb , cnta );
433
+ pr_info ("Max. threads per core: %3u\n" , __max_threads_per_core );
434
434
435
435
pr_info ("Allowing %u present CPUs plus %u hotplug CPUs\n" , assigned , disabled );
436
436
if (topo_info .nr_rejected_cpus )
Original file line number Diff line number Diff line change @@ -936,7 +936,7 @@ static __cpuidle void mwait_idle(void)
936
936
void select_idle_routine (const struct cpuinfo_x86 * c )
937
937
{
938
938
#ifdef CONFIG_SMP
939
- if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1 )
939
+ if (boot_option_idle_override == IDLE_POLL && __max_threads_per_core > 1 )
940
940
pr_warn_once ("WARNING: polling idle and HT enabled, performance may degrade\n" );
941
941
#endif
942
942
if (x86_idle_set () || boot_option_idle_override == IDLE_POLL )
Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ static void __init build_sched_topology(void)
563
563
564
564
void set_cpu_sibling_map (int cpu )
565
565
{
566
- bool has_smt = smp_num_siblings > 1 ;
566
+ bool has_smt = __max_threads_per_core > 1 ;
567
567
bool has_mp = has_smt || boot_cpu_data .x86_max_cores > 1 ;
568
568
struct cpuinfo_x86 * c = & cpu_data (cpu );
569
569
struct cpuinfo_x86 * o ;
You can’t perform that action at this time.
0 commit comments