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

Commit 1f925d3a authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched: walt/energy: use topology_get_cpu_scale to get the efficiency



topology_get_cpu_scale can be used to get the efficiency instead of
relying on arch_get_cpu_efficiency.

Change-Id: I6b68f1bfb58edf7f6d6ab0f1a16fa226c6367eab
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent a447a2a0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static int sched_energy_probe(struct platform_device *pdev)
	for_each_possible_cpu(cpu) {
		struct device *cpu_dev;
		struct dev_pm_opp *opp;
		int efficiency = cpu > 3 ? 1740 : 1024;
		int efficiency = topology_get_cpu_scale(NULL, cpu);

		max_efficiency = max(efficiency, max_efficiency);

@@ -209,7 +209,7 @@ static int sched_energy_probe(struct platform_device *pdev)
	for_each_possible_cpu(cpu) {
		unsigned long cpu_max_cap;
		struct sched_group_energy *sge_l0, *sge;
		int efficiency = cpu > 3 ? 1740 : 1024;
		int efficiency = topology_get_cpu_scale(NULL, cpu);

		cpu_max_cap = DIV_ROUND_UP(SCHED_CAPACITY_SCALE *
					   max_frequencies[cpu], max_freq);
+1 −10
Original line number Diff line number Diff line
@@ -2026,13 +2026,6 @@ void mark_task_starting(struct task_struct *p)
	update_task_cpu_cycles(p, cpu_of(rq));
}

unsigned long __weak arch_get_cpu_efficiency(int cpu)
{
	if (cpu > 3)
		return (SCHED_CAPACITY_SCALE * 17) / 10;
	return SCHED_CAPACITY_SCALE;
}

static cpumask_t all_cluster_cpus = CPU_MASK_NONE;
DECLARE_BITMAP(all_cluster_ids, NR_CPUS);
struct sched_cluster *sched_cluster[NR_CPUS];
@@ -2084,9 +2077,7 @@ static struct sched_cluster *alloc_new_cluster(const struct cpumask *cpus)

	raw_spin_lock_init(&cluster->load_lock);
	cluster->cpus = *cpus;
	// FIXME:
	cluster->efficiency = arch_get_cpu_efficiency(cpumask_first(cpus));
	cluster->efficiency = 1024;
	cluster->efficiency = topology_get_cpu_scale(NULL, cpumask_first(cpus));

	if (cluster->efficiency > max_possible_efficiency)
		max_possible_efficiency = cluster->efficiency;