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

Commit d8e3774e authored by Jonathan Avila's avatar Jonathan Avila Committed by Rohit Gupta
Browse files

cpufreq: Various changes to allow sugov to compile



Until various scheduler components are merged, our modified sugov cannot
compile due to dependencies on WALT.  Introduce the necessary stubs to
provide compilation.

Change-Id: I11e37ecaf5bf7eae2068bb9bb3d535e2d5571543
Signed-off-by: default avatarJonathan Avila <avilaj@codeaurora.org>
parent 42931bbf
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,15 @@ struct task_struct {
	 */
};

#ifdef CONFIG_SCHED_WALT
extern int sched_set_boost(int enable);
#else
static inline int sched_set_boost(int enable)
{
	return 0;
}
#endif

static inline struct pid *task_pid(struct task_struct *task)
{
	return task->pids[PIDTYPE_PID].pid;
@@ -1663,6 +1672,9 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);

#define SCHED_CPUFREQ_INTERCLUSTER_MIG (1U << 3)
#define SCHED_CPUFREQ_PL (1U << 5)

#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk)	TASK_SIZE
#endif
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ int sysctl_sched_rt_runtime = 950000;
/* CPUs with isolated domains */
cpumask_var_t cpu_isolated_map;

__read_mostly unsigned int sched_ravg_window = (3333333 * 6);

/*
 * __task_rq_lock - lock the rq @p resides on.
 */
+25 −0
Original line number Diff line number Diff line
@@ -2055,6 +2055,31 @@ static inline u64 irq_time_read(int cpu)
}
#endif /* CONFIG_IRQ_TIME_ACCOUNTING */

struct sched_walt_cpu_load {
	unsigned long prev_window_util;
	unsigned long nl;
	unsigned long pl;
	u64 ws;
};

#ifdef CONFIG_SCHED_WALT
inline unsigned long cpu_util_freq(int cpu,
				   struct sched_walt_cpu_load *walt_load);
inline unsigned long capacity_curr_of(int cpu);
extern unsigned int sched_ravg_window;
#else
static inline unsigned long
cpu_util_freq(int cpu, struct sched_walt_cpu_load *walt_load)
{
	return 0;
}
static inline unsigned long capacity_curr_of(int cpu)
{
	return 0;
}
extern unsigned int sched_ravg_window;
#endif /* CONFIG_SCHED_WALT */

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