ANDROID: arm: Enable dynamic sched_domain flag setting

The patch lets the arch_topology driver take over setting of
sched_domain flags that should be detected dynamically based on the
actual system topology.

cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
Change-Id: I5bc17383c5666e8ff35d5109016dec98474997ce
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
tirimbino
Morten Rasmussen 7 years ago committed by Chris Redpath
parent a991d17080
commit 5b814f5f90
  1. 3
      arch/arm/include/asm/topology.h
  2. 21
      arch/arm/kernel/topology.c

@ -33,6 +33,9 @@ const struct cpumask *cpu_coregroup_mask(int cpu);
/* Replace task scheduler's default cpu-invariant accounting */
#define arch_scale_cpu_capacity topology_get_cpu_scale
/* Enable topology flag updates */
#define arch_update_cpu_topology topology_update_cpu_topology
#else
static inline void init_cpu_topology(void) { }

@ -278,23 +278,38 @@ void store_cpu_topology(unsigned int cpuid)
update_cpu_capacity(cpuid);
topology_detect_flags();
pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
cpuid, cpu_topology[cpuid].thread_id,
cpu_topology[cpuid].core_id,
cpu_topology[cpuid].socket_id, mpidr);
}
#ifdef CONFIG_SCHED_MC
static int core_flags(void)
{
return cpu_core_flags() | topology_core_flags();
}
static inline int cpu_corepower_flags(void)
{
return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN;
return topology_core_flags()
| SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN;
}
#endif
static int cpu_flags(void)
{
return topology_cpu_flags();
}
static struct sched_domain_topology_level arm_topology[] = {
#ifdef CONFIG_SCHED_MC
{ cpu_corepower_mask, cpu_corepower_flags, SD_INIT_NAME(GMC) },
{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
{ cpu_coregroup_mask, core_flags, SD_INIT_NAME(MC) },
#endif
{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
{ cpu_cpu_mask, cpu_flags, SD_INIT_NAME(DIE) },
{ NULL, },
};

Loading…
Cancel
Save