diff options
| author | Paul Walmsley <[email protected]> | 2019-08-30 10:39:38 -0700 |
|---|---|---|
| committer | Paul Walmsley <[email protected]> | 2019-08-30 10:39:38 -0700 |
| commit | 015b269337e66120179f2da428a5195ec7a4675f (patch) | |
| tree | 66277b0dedbdef8fa76f80d334c9b55b045c4514 /include/linux | |
| parent | a256f2e329df0773022d28df2c3d206b9aaf1e61 (diff) | |
| parent | f51edcec5288556069d27ab7040a4ce8ca55b74e (diff) | |
Merge tag 'common/for-v5.4-rc1/cpu-topology' into for-v5.4-rc1-branch
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/arch_topology.h | 26 | ||||
| -rw-r--r-- | include/linux/topology.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 1cfe05ea1d89..42f2b5126094 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -33,4 +33,30 @@ unsigned long topology_get_freq_scale(int cpu) return per_cpu(freq_scale, cpu); } +struct cpu_topology { + int thread_id; + int core_id; + int package_id; + int llc_id; + cpumask_t thread_sibling; + cpumask_t core_sibling; + cpumask_t llc_sibling; +}; + +#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY +extern struct cpu_topology cpu_topology[NR_CPUS]; + +#define topology_physical_package_id(cpu) (cpu_topology[cpu].package_id) +#define topology_core_id(cpu) (cpu_topology[cpu].core_id) +#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) +#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) +#define topology_llc_cpumask(cpu) (&cpu_topology[cpu].llc_sibling) +void init_cpu_topology(void); +void store_cpu_topology(unsigned int cpuid); +const struct cpumask *cpu_coregroup_mask(int cpu); +void update_siblings_masks(unsigned int cpu); +void remove_cpu_topology(unsigned int cpuid); +void reset_cpu_topology(void); +#endif + #endif /* _LINUX_ARCH_TOPOLOGY_H_ */ diff --git a/include/linux/topology.h b/include/linux/topology.h index 47a3e3c08036..2a19d196af28 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -27,6 +27,7 @@ #ifndef _LINUX_TOPOLOGY_H #define _LINUX_TOPOLOGY_H +#include <linux/arch_topology.h> #include <linux/cpumask.h> #include <linux/bitops.h> #include <linux/mmzone.h> |