Messages in this thread Patch in this message | | | Date | Wed, 17 Feb 2016 13:47:35 -0000 | From | Thomas Gleixner <> | Subject | [patch 06/11] x86/topology: Provide helper to retrieve number of cpu packages |
| |
For services which are per package, e.g. intel_uncore, we need to know the number of possible packages in the system. Provide a helper. Unfortunately a macro to avoid inclue hell.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/topology.h | 3 +++ 1 file changed, 3 insertions(+)
--- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -127,6 +127,9 @@ extern const struct cpumask *cpu_coregro #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) #endif +#define topology_max_packages() \ + DIV_ROUND_UP(num_possible_cpus(), boot_cpu_data.x86_max_cores * smp_num_siblings) + static inline void arch_fix_phys_package_id(int num, u32 slot) { }
| |