powerpc: Detect the presence of big-cores via "ibm, thread-groups"
On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of threads in the core that share the L1 cache, translation cache and instruction data flow. This patch adds helper functions to parse the contents of "ibm,thread-groups" and populate a per-cpu variable to cache information about siblings of each CPU that share the L1, traslation cache and instruction data-flow. It also defines a new global variable named "has_big_cores" which indicates if the cores on this configuration have multiple groups of threads that share L1 cache. For each online CPU, it maintains a cpu_smallcore_mask, which indicates the online siblings which share the L1-cache with it. Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
bf6cbd0c87
commit
425752c63b
@@ -100,6 +100,7 @@ static inline void set_hard_smp_processor_id(int cpu, int phys)
|
||||
DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map);
|
||||
DECLARE_PER_CPU(cpumask_var_t, cpu_l2_cache_map);
|
||||
DECLARE_PER_CPU(cpumask_var_t, cpu_core_map);
|
||||
DECLARE_PER_CPU(cpumask_var_t, cpu_smallcore_map);
|
||||
|
||||
static inline struct cpumask *cpu_sibling_mask(int cpu)
|
||||
{
|
||||
@@ -116,6 +117,11 @@ static inline struct cpumask *cpu_l2_cache_mask(int cpu)
|
||||
return per_cpu(cpu_l2_cache_map, cpu);
|
||||
}
|
||||
|
||||
static inline struct cpumask *cpu_smallcore_mask(int cpu)
|
||||
{
|
||||
return per_cpu(cpu_smallcore_map, cpu);
|
||||
}
|
||||
|
||||
extern int cpu_to_core_id(int cpu);
|
||||
|
||||
/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
|
||||
@@ -166,6 +172,11 @@ static inline const struct cpumask *cpu_sibling_mask(int cpu)
|
||||
return cpumask_of(cpu);
|
||||
}
|
||||
|
||||
static inline const struct cpumask *cpu_smallcore_mask(int cpu)
|
||||
{
|
||||
return cpumask_of(cpu);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
|
Reference in New Issue
Block a user