sched: Merge cpu_to_core_group functions
Merge and simplify the two cpu_to_core_group variants so that the resulting function follows the same pattern like cpu_to_phys_group. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <20100831082843.953617555@de.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
ed2d372c07
commit
f269893c57
1 changed files with 5 additions and 13 deletions
|
@ -6552,31 +6552,23 @@ cpu_to_cpu_group(int cpu, const struct cpumask *cpu_map,
|
||||||
#ifdef CONFIG_SCHED_MC
|
#ifdef CONFIG_SCHED_MC
|
||||||
static DEFINE_PER_CPU(struct static_sched_domain, core_domains);
|
static DEFINE_PER_CPU(struct static_sched_domain, core_domains);
|
||||||
static DEFINE_PER_CPU(struct static_sched_group, sched_group_core);
|
static DEFINE_PER_CPU(struct static_sched_group, sched_group_core);
|
||||||
#endif /* CONFIG_SCHED_MC */
|
|
||||||
|
|
||||||
#if defined(CONFIG_SCHED_MC) && defined(CONFIG_SCHED_SMT)
|
|
||||||
static int
|
static int
|
||||||
cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
|
cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
|
||||||
struct sched_group **sg, struct cpumask *mask)
|
struct sched_group **sg, struct cpumask *mask)
|
||||||
{
|
{
|
||||||
int group;
|
int group;
|
||||||
|
#ifdef CONFIG_SCHED_SMT
|
||||||
cpumask_and(mask, topology_thread_cpumask(cpu), cpu_map);
|
cpumask_and(mask, topology_thread_cpumask(cpu), cpu_map);
|
||||||
group = cpumask_first(mask);
|
group = cpumask_first(mask);
|
||||||
|
#else
|
||||||
|
group = cpu;
|
||||||
|
#endif
|
||||||
if (sg)
|
if (sg)
|
||||||
*sg = &per_cpu(sched_group_core, group).sg;
|
*sg = &per_cpu(sched_group_core, group).sg;
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
#elif defined(CONFIG_SCHED_MC)
|
#endif /* CONFIG_SCHED_MC */
|
||||||
static int
|
|
||||||
cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
|
|
||||||
struct sched_group **sg, struct cpumask *unused)
|
|
||||||
{
|
|
||||||
if (sg)
|
|
||||||
*sg = &per_cpu(sched_group_core, cpu).sg;
|
|
||||||
return cpu;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct static_sched_domain, phys_domains);
|
static DEFINE_PER_CPU(struct static_sched_domain, phys_domains);
|
||||||
static DEFINE_PER_CPU(struct static_sched_group, sched_group_phys);
|
static DEFINE_PER_CPU(struct static_sched_group, sched_group_phys);
|
||||||
|
|
Loading…
Add table
Reference in a new issue