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

Commit 3e705e46 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa Committed by Joonwoo Park
Browse files

sched: Port boost setting mechanisms to EAS



This patch brings in the ability to set or unset scheduler boost
and have that reflect in the various cgroups/core control state.
It does not contain any changes to task placement or frequency
guidance. Those will be brought in as part of subsequent patches.

Change-Id: Idf59c2f7426416a4248881e5baf63059b1253e75
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent 8862d640
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2640,7 +2640,6 @@ extern int sched_set_window(u64 window_start, unsigned int window_size);
extern unsigned long sched_get_busy(int cpu);
extern void sched_get_cpus_busy(struct sched_load *busy,
				const struct cpumask *query_cpus);
extern int sched_set_boost(int enable);
extern int sched_set_init_task_load(struct task_struct *p, int init_load_pct);
extern u32 sched_get_init_task_load(struct task_struct *p);
extern int sched_set_static_cpu_pwr_cost(int cpu, unsigned int cost);
@@ -2673,11 +2672,6 @@ static inline unsigned long sched_get_busy(int cpu)
static inline void sched_get_cpus_busy(struct sched_load *busy,
				       const struct cpumask *query_cpus) {};

static inline int sched_set_boost(int enable)
{
	return -EINVAL;
}

static inline int sched_update_freq_max_load(const cpumask_t *cpumask)
{
	return 0;
@@ -2703,6 +2697,7 @@ extern int sched_set_init_task_load(struct task_struct *p, int init_load_pct);
extern u32 sched_get_init_task_load(struct task_struct *p);
extern void sched_update_cpu_freq_min_max(const cpumask_t *cpus, u32 fmin,
					  u32 fmax);
extern int sched_set_boost(int enable);
#else
static inline int
register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
@@ -2710,6 +2705,11 @@ register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
	return 0;
}
static inline void sched_set_io_is_busy(int val) {};

static inline int sched_set_boost(int enable)
{
	return -EINVAL;
}
#endif /* CONFIG_SCHED_WALT */

#ifndef CONFIG_SCHED_WALT
+1 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ extern unsigned int sysctl_sched_init_task_load_pct;
extern unsigned int sysctl_sched_cpu_high_irqload;
extern unsigned int sysctl_sched_use_walt_cpu_util;
extern unsigned int sysctl_sched_use_walt_task_util;
extern unsigned int sysctl_sched_boost;
#endif

#ifdef CONFIG_SCHED_HMP
@@ -55,7 +56,6 @@ extern unsigned int sysctl_sched_downmigrate_pct;
extern unsigned int sysctl_sched_group_upmigrate_pct;
extern unsigned int sysctl_sched_group_downmigrate_pct;
extern unsigned int sysctl_early_detection_duration;
extern unsigned int sysctl_sched_boost;
extern unsigned int sysctl_sched_small_wakee_task_load_pct;
extern unsigned int sysctl_sched_big_waker_task_load_pct;
extern unsigned int sysctl_sched_select_prev_cpu_us;
+17 −17
Original line number Diff line number Diff line
@@ -523,6 +523,23 @@ TRACE_EVENT(sched_migration_update_sum,
		__entry->src_nt_cs, __entry->src_nt_ps, __entry->dst_nt_cs, __entry->dst_nt_ps)
);

TRACE_EVENT(sched_set_boost,

	TP_PROTO(int type),

	TP_ARGS(type),

	TP_STRUCT__entry(
		__field(int, type			)
	),

	TP_fast_assign(
		__entry->type = type;
	),

	TP_printk("type %d", __entry->type)
);

#endif

#ifdef CONFIG_SCHED_WALT
@@ -639,23 +656,6 @@ DEFINE_EVENT(sched_cpu_load, sched_cpu_load_cgroup,
	TP_ARGS(rq, idle, irqload, power_cost, temp)
);

TRACE_EVENT(sched_set_boost,

	TP_PROTO(int type),

	TP_ARGS(type),

	TP_STRUCT__entry(
		__field(int, type			)
	),

	TP_fast_assign(
		__entry->type = type;
	),

	TP_printk("type %d", __entry->type)
);

TRACE_EVENT(sched_reset_all_window_stats,

	TP_PROTO(u64 window_start, u64 window_size, u64 time_taken,
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o
obj-y += wait.o swait.o completion.o idle.o sched_avg.o
obj-$(CONFIG_SCHED_HMP) += hmp.o boost.o
obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o energy.o
obj-$(CONFIG_SCHED_WALT) += walt.o
obj-$(CONFIG_SCHED_WALT) += walt.o boost.o
obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o
obj-$(CONFIG_SCHEDSTATS) += stats.o
obj-$(CONFIG_SCHED_DEBUG) += debug.o
+19 −17
Original line number Diff line number Diff line
@@ -2650,6 +2650,11 @@ extern unsigned long thermal_cap(int cpu);

extern void clear_hmp_request(int cpu);

extern int got_boost_kick(void);
extern void clear_boost_kick(int cpu);
extern enum sched_boost_policy sched_boost_policy(void);
extern void sched_boost_parse_dt(void);

#else	/* CONFIG_SCHED_WALT */

struct hmp_sched_stats;
@@ -2781,6 +2786,20 @@ static inline unsigned long thermal_cap(int cpu)

static inline void clear_hmp_request(int cpu) { }

static inline int got_boost_kick(void)
{
	return 0;
}

static inline void clear_boost_kick(int cpu) { }

static inline enum sched_boost_policy sched_boost_policy(void)
{
	return SCHED_BOOST_NONE;
}

static inline void sched_boost_parse_dt(void) { }

#endif	/* CONFIG_SCHED_WALT */

#ifdef CONFIG_SCHED_HMP
@@ -2793,7 +2812,6 @@ extern void notify_migration(int src_cpu, int dest_cpu,
extern void note_task_waking(struct task_struct *p, u64 wallclock);
extern void
check_for_freq_change(struct rq *rq, bool check_pred, bool check_groups);
extern int got_boost_kick(void);
extern void clear_ed_task(struct task_struct *p, struct rq *rq);
extern void fixup_nr_big_tasks(struct hmp_sched_stats *stats,
					struct task_struct *p, s64 delta);
@@ -2802,8 +2820,6 @@ extern unsigned int power_cost(int cpu, u64 demand);
extern unsigned int cpu_temp(int cpu);
extern void pre_big_task_count_change(const struct cpumask *cpus);
extern void post_big_task_count_change(const struct cpumask *cpus);
extern enum sched_boost_policy sched_boost_policy(void);
extern void sched_boost_parse_dt(void);
extern void set_hmp_defaults(void);
extern void update_avg_burst(struct task_struct *p);
extern void set_task_last_switch_out(struct task_struct *p, u64 wallclock);
@@ -2838,7 +2854,6 @@ static inline bool is_short_burst_task(struct task_struct *p)
	       p->ravg.avg_sleep_time > sysctl_sched_short_sleep;
}

extern void clear_boost_kick(int cpu);
#else
static inline bool energy_aware(void)
{
@@ -2855,11 +2870,6 @@ static inline void note_task_waking(struct task_struct *p, u64 wallclock) { }
static inline void
check_for_freq_change(struct rq *rq, bool check_pred, bool check_groups) { }

static inline int got_boost_kick(void)
{
	return 0;
}

static inline void clear_ed_task(struct task_struct *p, struct rq *rq) { }

static inline void fixup_nr_big_tasks(struct hmp_sched_stats *stats,
@@ -2884,13 +2894,6 @@ static inline void pre_big_task_count_change(const struct cpumask *cpus) { }

static inline void post_big_task_count_change(const struct cpumask *cpus) { }

static inline enum sched_boost_policy sched_boost_policy(void)
{
	return SCHED_BOOST_NONE;
}

static inline void sched_boost_parse_dt(void) { }

static inline void set_hmp_defaults(void) { }

static inline void update_avg_burst(struct task_struct *p) { }
@@ -2898,5 +2901,4 @@ static inline void update_avg_burst(struct task_struct *p) { }
static inline void set_task_last_switch_out(struct task_struct *p,
					    u64 wallclock) { }

static inline void clear_boost_kick(int cpu) { }
#endif /* CONFIG_SCHED_HMP */
Loading