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

Commit 12912ba1 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
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>
parent e1856dad
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@
#include "sched.h"
#include "tune.h"

#ifdef CONFIG_SCHED_WALT
unsigned long boosted_cpu_util(int cpu);
#endif

#define SUGOV_KTHREAD_PRIORITY	50

struct sugov_tunables {
@@ -182,8 +178,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);
	*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
@@ -4850,9 +4850,6 @@ static inline void hrtick_update(struct rq *rq)
#ifdef CONFIG_SMP
static unsigned long capacity_orig_of(int cpu);
static unsigned long cpu_util(int cpu);
unsigned long boosted_cpu_util(int cpu);
#else
#define boosted_cpu_util(cpu) cpu_util_freq(cpu)
#endif

/*
@@ -6206,9 +6203,9 @@ schedtune_task_margin(struct task_struct *p)
#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
@@ -1910,6 +1910,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);
#endif

extern unsigned int capacity_margin_freq;