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

Commit f6686697 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

sched: cpufreq: Limit governor updates to WALT changes alone



It's not necessary to keep reporting load to the governor
if it doesn't change in a window. Limit updates to when
we expect load changes - after window rollover and when
we send updates related to intercluster migrations.

Change-Id: I3232d40f3d54b0b81cfafdcdb99b534df79327bf
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent a65aafed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3905,6 +3905,7 @@ static inline unsigned long rlimit_max(unsigned int limit)
#define SCHED_CPUFREQ_DL	(1U << 1)
#define SCHED_CPUFREQ_IOWAIT	(1U << 2)
#define SCHED_CPUFREQ_INTERCLUSTER_MIG (1U << 3)
#define SCHED_CPUFREQ_WALT (1U << 4)

#define SCHED_CPUFREQ_RT_DL	(SCHED_CPUFREQ_RT | SCHED_CPUFREQ_DL)

+3 −1
Original line number Diff line number Diff line
@@ -2250,8 +2250,10 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags)
#ifdef CONFIG_SCHED_WALT
	/*
	 * Skip if we've already reported, but not if this is an inter-cluster
	 * migration
	 * migration. Also only allow WALT update sites.
	 */
	if (!(flags & SCHED_CPUFREQ_WALT))
		return;
	if (!sched_disable_window_stats &&
		(rq->load_reported_window == rq->window_start) &&
		!(flags & SCHED_CPUFREQ_INTERCLUSTER_MIG))
+5 −3
Original line number Diff line number Diff line
@@ -871,8 +871,10 @@ void fixup_busy_time(struct task_struct *p, int new_cpu)
	migrate_top_tasks(p, src_rq, dest_rq);

	if (!same_freq_domain(new_cpu, task_cpu(p))) {
		cpufreq_update_util(dest_rq, SCHED_CPUFREQ_INTERCLUSTER_MIG);
		cpufreq_update_util(src_rq, SCHED_CPUFREQ_INTERCLUSTER_MIG);
		cpufreq_update_util(dest_rq, SCHED_CPUFREQ_INTERCLUSTER_MIG |
					     SCHED_CPUFREQ_WALT);
		cpufreq_update_util(src_rq, SCHED_CPUFREQ_INTERCLUSTER_MIG |
					    SCHED_CPUFREQ_WALT);
	}

	if (p == src_rq->ed_task) {
@@ -3040,7 +3042,7 @@ void walt_irq_work(struct irq_work *irq_work)

	for_each_sched_cluster(cluster)
		for_each_cpu(cpu, &cluster->cpus)
			cpufreq_update_util(cpu_rq(cpu), 0);
			cpufreq_update_util(cpu_rq(cpu), SCHED_CPUFREQ_WALT);

	for_each_cpu(cpu, cpu_possible_mask)
		raw_spin_unlock(&cpu_rq(cpu)->lock);