cpu_topology
static DEFINE_PER_CPU(struct cpu, cpu_topology);
register_cpu(&per_cpu(cpu_topology, cpu), cpu);
struct cpu_topology *cpuid_topo = &cpu_topology[cpuid];
cpuid, cpu_topology[cpuid].thread_id,
cpu_topology[cpuid].core_id,
cpu_topology[cpuid].package_id, mpidr);
struct cpu_topology *cpuid_topo = &cpu_topology[cpuid];
cpuid_topo->core_id = cpu_topology[cpu].core_id;
cpuid_topo->package_id = cpu_topology[cpu].package_id;
max_socket = max(max_socket, cpu_topology[cpu].package_id);
cpu_topology[cpuid].core_id,
cpu_topology[cpuid].package_id);
extern struct cpu_topology_s390 cpu_topology[NR_CPUS];
#define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
#define topology_thread_id(cpu) (cpu_topology[cpu].thread_id)
#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_mask)
#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_mask)
#define topology_book_id(cpu) (cpu_topology[cpu].book_id)
#define topology_book_cpumask(cpu) (&cpu_topology[cpu].book_mask)
#define topology_drawer_id(cpu) (cpu_topology[cpu].drawer_id)
#define topology_drawer_cpumask(cpu) (&cpu_topology[cpu].drawer_mask)
#define topology_cpu_dedicated(cpu) (cpu_topology[cpu].dedicated)
#define topology_booted_cores(cpu) (cpu_topology[cpu].booted_cores)
topo = &cpu_topology[cpu];
topo = &cpu_topology[cpu];
topo = &cpu_topology[cpu];
topo_package = &cpu_topology[pkg_first];
topo_sibling = &cpu_topology[sibling];
return &cpu_topology[cpu].core_mask;
return &cpu_topology[cpu].book_mask;
return &cpu_topology[cpu].drawer_mask;
struct cpu_topology_s390 cpu_topology[NR_CPUS];
EXPORT_SYMBOL_GPL(cpu_topology);
cpu_topology[cpu].package_id = package_id;
cpu_topology[cpu].cluster_id = cluster_id;
cpu_topology[cpu].core_id = core_id;
cpu_topology[cpu].thread_id = i;
cpu_topology[cpu].package_id = package_id;
cpu_topology[cpu].cluster_id = cluster_id;
cpu_topology[cpu].core_id = core_id;
if (cpu_topology[cpu].package_id < 0) {
struct cpu_topology cpu_topology[NR_CPUS];
EXPORT_SYMBOL_GPL(cpu_topology);
if (cpumask_subset(&cpu_topology[cpu].core_sibling, core_mask)) {
core_mask = &cpu_topology[cpu].core_sibling;
if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask))
core_mask = &cpu_topology[cpu].llc_sibling;
cpumask_subset(core_mask, &cpu_topology[cpu].cluster_sibling))
core_mask = &cpu_topology[cpu].cluster_sibling;
&cpu_topology[cpu].cluster_sibling))
return &cpu_topology[cpu].cluster_sibling;
struct cpu_topology *cpu_topo, *cpuid_topo = &cpu_topology[cpuid];
cpu_topo = &cpu_topology[cpu];
struct cpu_topology *cpu_topo = &cpu_topology[cpu];
struct cpu_topology *cpu_topo = &cpu_topology[cpu];
cpu_topology[cpu].thread_id = topology_id;
cpu_topology[cpu].core_id = topology_id;
cpu_topology[cpu].thread_id = -1;
cpu_topology[cpu].core_id = topology_id;
cpu_topology[cpu].cluster_id = topology_id;
cpu_topology[cpu].package_id = topology_id;
struct cpu_topology *cpuid_topo = &cpu_topology[cpuid];
return cpu_topology[cpu].thread_id != -1;
extern struct cpu_topology cpu_topology[NR_CPUS];
#define topology_physical_package_id(cpu) (cpu_topology[cpu].package_id)
#define topology_cluster_id(cpu) (cpu_topology[cpu].cluster_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_cluster_cpumask(cpu) (&cpu_topology[cpu].cluster_sibling)
#define topology_llc_cpumask(cpu) (&cpu_topology[cpu].llc_sibling)
struct cpu_topology *topo;
struct cpu_topology *topo;
void cpu_topology__delete(struct cpu_topology *tp)
bool cpu_topology__smt_on(const struct cpu_topology *topology)
bool cpu_topology__core_wide(const struct cpu_topology *topology,
const struct cpu_topology *online_topology(void)
static const struct cpu_topology *topology;
struct cpu_topology *cpu_topology__new(void)
struct cpu_topology *tp = NULL;
static int build_cpu_topology(struct cpu_topology *tp, int cpu)
const struct cpu_topology *online_topology(void);
struct cpu_topology *cpu_topology__new(void);
void cpu_topology__delete(struct cpu_topology *tp);
bool cpu_topology__smt_on(const struct cpu_topology *topology);
bool cpu_topology__core_wide(const struct cpu_topology *topology,
FEAT_OPR(CPU_TOPOLOGY, cpu_topology, true),
struct cpu_topology *tp;
const struct cpu_topology *topology;
struct cpu_topology cpu_top;
struct cpu_topology cpu_top;
int get_physical_node_id(struct cpu_topology *thiscpu)
int set_thread_siblings(struct cpu_topology *thiscpu)
cpus = calloc(1, (topo.max_cpu_num + 1) * sizeof(struct cpu_topology));