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

Commit 3b32aeac authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
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>
parent 40a11f70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ static void sugov_get_util(unsigned long *util, unsigned long *max, int cpu)
	*util = min(rq->cfs.avg.util_avg, cfs_max);
	*max = cfs_max;

	*util = cpu_util_freq(cpu, &loadcpu->walt_load);
	*util = boosted_cpu_util(cpu, &loadcpu->walt_load);
}

static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
+2 −5
Original line number Diff line number Diff line
@@ -4995,12 +4995,9 @@ static inline void update_overutilized_status(struct rq *rq)
		set_sd_overutilized(sd);
	rcu_read_unlock();
}

unsigned long boosted_cpu_util(int cpu);
#else

#define update_overutilized_status(rq) do {} while (0)
#define boosted_cpu_util(cpu) cpu_util_freq(cpu, NULL)

#endif /* CONFIG_SMP */

@@ -6326,9 +6323,9 @@ schedtune_task_margin(struct task_struct *task)
#endif /* CONFIG_SCHED_TUNE */

unsigned long
boosted_cpu_util(int cpu)
boosted_cpu_util(int cpu, struct sched_walt_cpu_load *walt_load)
{
	unsigned long util = cpu_util_freq(cpu, NULL);
	unsigned long util = cpu_util_freq(cpu, walt_load);
	long margin = schedtune_cpu_margin(util, cpu);

	trace_sched_boost_cpu(cpu, util, margin);
+2 −0
Original line number Diff line number Diff line
@@ -2021,6 +2021,8 @@ cpu_util_freq(int cpu, struct sched_walt_cpu_load *walt_load)

#endif /* CONFIG_SCHED_WALT */

extern unsigned long
boosted_cpu_util(int cpu, struct sched_walt_cpu_load *walt_load);
extern unsigned int capacity_margin_freq;

static inline unsigned long