Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 504f2588 authored by Morten Rasmussen's avatar Morten Rasmussen Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
Change-Id: I5bc17383c5666e8ff35d5109016dec98474997ce
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
Git-commit: 5b814f5f
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent eeab6288
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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) { }
+18 −3
Original line number Diff line number Diff line
@@ -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, },
};