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

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

ANDROID: arm64: 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: Catalin Marinas <catalin.marinas@arm.com>
cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
Change-Id: I7886c0a53899987e77ef6937e1c667bf32a58bfd
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
Git-commit: f505b776
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 504f2588
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ int pcibus_to_node(struct pci_bus *bus);
/* 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

#include <asm-generic/topology.h>

#endif /* _ASM_ARM_TOPOLOGY_H */
+33 −0
Original line number Diff line number Diff line
@@ -280,8 +280,39 @@ void store_cpu_topology(unsigned int cpuid)

topology_populated:
	update_siblings_masks(cpuid);
	topology_detect_flags();
}

#ifdef CONFIG_SCHED_SMT
static int smt_flags(void)
{
	return cpu_smt_flags() | topology_smt_flags();
}
#endif

#ifdef CONFIG_SCHED_MC
static int core_flags(void)
{
	return cpu_core_flags() | topology_core_flags();
}
#endif

static int cpu_flags(void)
{
	return topology_cpu_flags();
}

static struct sched_domain_topology_level arm64_topology[] = {
#ifdef CONFIG_SCHED_SMT
	{ cpu_smt_mask, smt_flags, SD_INIT_NAME(SMT) },
#endif
#ifdef CONFIG_SCHED_MC
	{ cpu_coregroup_mask, core_flags, SD_INIT_NAME(MC) },
#endif
	{ cpu_cpu_mask, cpu_flags, SD_INIT_NAME(DIE) },
	{ NULL, }
};

static void __init reset_cpu_topology(void)
{
	unsigned int cpu;
@@ -310,4 +341,6 @@ void __init init_cpu_topology(void)
	 */
	if (of_have_populated_dt() && parse_dt_topology())
		reset_cpu_topology();
	else
		set_sched_topology(arm64_topology);
}