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

Commit d8043c8b authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Jonathan Avila
Browse files

sched: Update WALT stats also in boosted_cpu_util()



The schedutil is calling twice into the scheduler while querying
the load of each CPU. The cpu_util_freq() is called first to
get the CPU un-boosted load and WALT stats. Then boosted_cpu_util()
is called to get the boosted CPU load. This results in doing the
the same calculations twice in the scheduler and printing
sched_load_to_gov trace point twice. Fix this inefficiency by
changing boosted_cpu_util() to update WALT stats along with
boosted CPU load.

Change-Id: Ia825cafca6a25c56b0edb1ae8c55e7c7277f2968
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
[avilaj@codeaurora.org: merge conflicts due to 4.19 port]
Signed-off-by: default avatarJonathan Avila <avilaj@codeaurora.org>
parent 0b24708f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
	sg_cpu->max = max;
	sg_cpu->bw_dl = cpu_bw_dl(rq);

	return cpu_util_freq(sg_cpu->cpu, &sg_cpu->walt_load);
	return boosted_cpu_util(sg_cpu->cpu, 0, &sg_cpu->walt_load);
#else
	unsigned long util = boosted_cpu_util(sg_cpu->cpu, cpu_util_rt(rq));

+3 −2
Original line number Diff line number Diff line
@@ -6004,9 +6004,10 @@ schedtune_task_margin(struct task_struct *task)
}

unsigned long
boosted_cpu_util(int cpu, unsigned long other_util)
boosted_cpu_util(int cpu, unsigned long other_util,
		 struct sched_walt_cpu_load *walt_load)
{
	unsigned long util = cpu_util_cfs(cpu_rq(cpu)) + other_util;
	unsigned long util = cpu_util_freq(cpu, walt_load) + other_util;
	long margin = schedtune_cpu_margin(util, cpu);

	trace_sched_boost_cpu(cpu, util, margin);
+3 −1
Original line number Diff line number Diff line
@@ -2073,8 +2073,10 @@ static inline unsigned long cpu_util_cum(int cpu, int delta)
	return (delta >= capacity) ? capacity : delta;
}


#ifdef CONFIG_SCHED_WALT
extern unsigned long boosted_cpu_util(int cpu, unsigned long other_util,
				      struct sched_walt_cpu_load *walt_load);

u64 freq_policy_load(struct rq *rq);

extern u64 walt_load_reported_window;
+0 −2
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@ int schedtune_prefer_idle(struct task_struct *tsk);
void schedtune_enqueue_task(struct task_struct *p, int cpu);
void schedtune_dequeue_task(struct task_struct *p, int cpu);

unsigned long boosted_cpu_util(int cpu, unsigned long other_util);

#else /* CONFIG_SCHED_TUNE */

#define schedtune_cpu_boost(cpu)  0