mirror of https://gitee.com/openkylin/linux.git
cpumask: cpu_coregroup_mask(): x86
Impact: New API Like cpu_coregroup_map, but returns a (const) pointer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Cc: Ingo Molnar <mingo@redhat.com>
This commit is contained in:
parent
2258a5bb10
commit
030bb203e0
|
@ -231,6 +231,7 @@ static inline int node_to_first_cpu(int node)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern cpumask_t cpu_coregroup_map(int cpu);
|
extern cpumask_t cpu_coregroup_map(int cpu);
|
||||||
|
extern const struct cpumask *cpu_coregroup_mask(int cpu);
|
||||||
|
|
||||||
#ifdef ENABLE_TOPO_DEFINES
|
#ifdef ENABLE_TOPO_DEFINES
|
||||||
#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
|
#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
|
||||||
|
|
|
@ -497,7 +497,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* maps the cpu to the sched domain representing multi-core */
|
/* maps the cpu to the sched domain representing multi-core */
|
||||||
cpumask_t cpu_coregroup_map(int cpu)
|
const struct cpumask *cpu_coregroup_mask(int cpu)
|
||||||
{
|
{
|
||||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||||
/*
|
/*
|
||||||
|
@ -505,9 +505,14 @@ cpumask_t cpu_coregroup_map(int cpu)
|
||||||
* And for power savings, we return cpu_core_map
|
* And for power savings, we return cpu_core_map
|
||||||
*/
|
*/
|
||||||
if (sched_mc_power_savings || sched_smt_power_savings)
|
if (sched_mc_power_savings || sched_smt_power_savings)
|
||||||
return per_cpu(cpu_core_map, cpu);
|
return &per_cpu(cpu_core_map, cpu);
|
||||||
else
|
else
|
||||||
return c->llc_shared_map;
|
return &c->llc_shared_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpumask_t cpu_coregroup_map(int cpu)
|
||||||
|
{
|
||||||
|
return *cpu_coregroup_mask(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void impress_friends(void)
|
static void impress_friends(void)
|
||||||
|
|
Loading…
Reference in New Issue