sched: use rq_clock if WALT is not enabled

Use rq_clock to send timestamp to util update handler
if WALT is not enabled in the system.

Change-Id: I1e367c506a2fc286a4dfbac9d1f6cdd897d31f2d
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
This commit is contained in:
Santosh Mardi 2020-02-20 16:37:32 +05:30 • committed by Gerrit - the friendly Code Review server
commit 0a016eaf4f

View file

@ -2169,7 +2169,7 @@ cpu_util_freq_walt(int cpu, struct sched_walt_cpu_load *walt_load);
#define sched_ravg_window TICK_NSEC
static inline u64 sched_ktime_clock(void)
{
return 0;
return sched_clock();
}
#endif
@ -2646,16 +2646,20 @@ DECLARE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data);
static inline void cpufreq_update_util(struct rq *rq, unsigned int flags)
{
struct update_util_data *data;
u64 clock;
#ifdef CONFIG_SCHED_WALT
if (!(flags & SCHED_CPUFREQ_WALT))
return;
clock = sched_ktime_clock();
#else
clock = rq_clock(rq);
#endif
data = rcu_dereference_sched(*per_cpu_ptr(&cpufreq_update_util_data,
cpu_of(rq)));
if (data)
data->func(data, sched_ktime_clock(), flags);
data->func(data, clock, flags);
}
#else
static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) {}