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

Commit a65aafed authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

sched: walt: Provide the most recent window_start value to cpufreq



cpufreq may require rq->window_start for various reasons.
Also switch the timestamp passed to the governor from
sched_clock() to sched_ktime_clock() in order to ensure
that cpufreq can compare the timestamp to rq->window_start.

Change-Id: Icb78f8923a678f724b3e1101ef2d4248e7b2a796
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent 5b8e7a4a
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1779,6 +1779,7 @@ struct sched_walt_cpu_load {
	unsigned long prev_window_util;
	unsigned long nl;
	unsigned long pl;
	u64 ws;
};

static inline unsigned long cpu_util_cum(int cpu, int delta)
@@ -1828,6 +1829,7 @@ cpu_util_freq(int cpu, struct sched_walt_cpu_load *walt_load)
			walt_load->prev_window_util = util;
			walt_load->nl = nl;
			walt_load->pl = 0;
			walt_load->ws = rq->window_start;
		}
	}
#endif
@@ -2207,6 +2209,15 @@ static inline u64 irq_time_read(int cpu)
}
#endif /* CONFIG_IRQ_TIME_ACCOUNTING */

#ifdef CONFIG_SCHED_WALT
u64 sched_ktime_clock(void);
#else /* CONFIG_SCHED_WALT */
static inline u64 sched_ktime_clock(void)
{
	return 0;
}
#endif /* CONFIG_SCHED_WALT */

#ifdef CONFIG_CPU_FREQ
DECLARE_PER_CPU(struct update_util_data *, cpufreq_update_util_data);

@@ -2251,7 +2262,7 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags)
	data = rcu_dereference_sched(*per_cpu_ptr(&cpufreq_update_util_data,
					cpu_of(rq)));
	if (data)
		data->func(data, sched_clock(), flags);
		data->func(data, sched_ktime_clock(), flags);
}

static inline void cpufreq_update_this_cpu(struct rq *rq, unsigned int flags)
@@ -2336,7 +2347,6 @@ extern unsigned int __read_mostly sched_downmigrate;
extern unsigned int  __read_mostly sysctl_sched_spill_nr_run;
extern unsigned int  __read_mostly sched_load_granule;

extern u64 sched_ktime_clock(void);
extern int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb);
extern void reset_cpu_hmp_stats(int cpu, int reset_cra);
extern int update_preferred_cluster(struct related_thread_group *grp,
+0 −7
Original line number Diff line number Diff line
@@ -194,8 +194,6 @@ static inline int exiting_task(struct task_struct *p)
	return (p->ravg.sum_history[0] == EXITING_TASK_MARKER);
}

extern u64 sched_ktime_clock(void);

static inline struct sched_cluster *cpu_cluster(int cpu)
{
	return cpu_rq(cpu)->cluster;
@@ -335,11 +333,6 @@ static inline void mark_task_starting(struct task_struct *p) { }
static inline void set_window_start(struct rq *rq) { }
static inline int sched_cpu_high_irqload(int cpu) { return 0; }

static inline u64 sched_ktime_clock(void)
{
	return 0;
}

static inline void sched_account_irqstart(int cpu, struct task_struct *curr,
					  u64 wallclock)
{