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

Commit c9bf15a3 authored by Juri Lelli's avatar Juri Lelli Committed by Dmitry Shmidt
Browse files

ANDROID: sched/fair: cpufreq_sched triggers for load balancing



As we don't trigger freq changes from {en,de}queue_task_fair() during load
balancing, we need to do explicitly so on load balancing paths.

[smuckle@linaro.org: move update_capacity_of calls so rq lock is held]

cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarJuri Lelli <juri.lelli@arm.com>
Signed-off-by: default avatarSteve Muckle <smuckle@linaro.org>
Signed-off-by: default avatarAndres Oportus <andresoportus@google.com>
parent 43aac893
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -7065,6 +7065,10 @@ static void attach_one_task(struct rq *rq, struct task_struct *p)
{
	raw_spin_lock(&rq->lock);
	attach_task(rq, p);
	/*
	 * We want to potentially raise target_cpu's OPP.
	 */
	update_capacity_of(cpu_of(rq));
	raw_spin_unlock(&rq->lock);
}

@@ -7086,6 +7090,11 @@ static void attach_tasks(struct lb_env *env)
		attach_task(env->dst_rq, p);
	}

	/*
	 * We want to potentially raise env.dst_cpu's OPP.
	 */
	update_capacity_of(env->dst_cpu);

	raw_spin_unlock(&env->dst_rq->lock);
}

@@ -8284,6 +8293,11 @@ static int load_balance(int this_cpu, struct rq *this_rq,
		 * ld_moved     - cumulative load moved across iterations
		 */
		cur_ld_moved = detach_tasks(&env);
		/*
		 * We want to potentially lower env.src_cpu's OPP.
		 */
		if (cur_ld_moved)
			update_capacity_of(env.src_cpu);

		/*
		 * We've detached some tasks from busiest_rq. Every
@@ -8650,6 +8664,10 @@ static int active_load_balance_cpu_stop(void *data)
		p = detach_one_task(&env);
		if (p) {
			schedstat_inc(sd->alb_pushed);
			/*
			 * We want to potentially lower env.src_cpu's OPP.
			 */
			update_capacity_of(env.src_cpu);
			/* Active balancing done, reset the failure counter. */
			sd->nr_balance_failed = 0;
		} else {