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

Commit a34247a3 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/walt: improve the scheduler



This change is for general scheduler improvement.

Change-Id: Ice980dde340bff8362b4f2adc679423d8f54e8e4
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 060e1a87
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -714,7 +714,7 @@ struct task_struct {
	u32 init_load_pct;
	u32 init_load_pct;
	u64 last_wake_ts;
	u64 last_wake_ts;
	u64 last_switch_out_ts;
	u64 last_switch_out_ts;
	u64 last_cpu_selected_ts;
	u64 last_enqueued_ts;
	struct related_thread_group *grp;
	struct related_thread_group *grp;
	struct list_head grp_list;
	struct list_head grp_list;
	u64 cpu_cycles;
	u64 cpu_cycles;
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ extern unsigned int sysctl_sched_cpu_high_irqload;
extern unsigned int sysctl_sched_boost;
extern unsigned int sysctl_sched_boost;
extern unsigned int sysctl_sched_group_upmigrate_pct;
extern unsigned int sysctl_sched_group_upmigrate_pct;
extern unsigned int sysctl_sched_group_downmigrate_pct;
extern unsigned int sysctl_sched_group_downmigrate_pct;
extern unsigned int sysctl_sched_walt_rotate_big_tasks;


extern int
extern int
walt_proc_update_handler(struct ctl_table *table, int write,
walt_proc_update_handler(struct ctl_table *table, int write,
+7 −4
Original line number Original line Diff line number Diff line
@@ -493,8 +493,8 @@ DEFINE_EVENT(sched_cpu_load, sched_cpu_load_lb,


TRACE_EVENT(sched_load_to_gov,
TRACE_EVENT(sched_load_to_gov,


	TP_PROTO(struct rq *rq, u64 aggr_grp_load, u32 tt_load, u64 freq_aggr_thresh, u64 load, int policy),
	TP_PROTO(struct rq *rq, u64 aggr_grp_load, u32 tt_load, u64 freq_aggr_thresh, u64 load, int policy, int big_task_rotation),
	TP_ARGS(rq, aggr_grp_load, tt_load, freq_aggr_thresh, load, policy),
	TP_ARGS(rq, aggr_grp_load, tt_load, freq_aggr_thresh, load, policy, big_task_rotation),


	TP_STRUCT__entry(
	TP_STRUCT__entry(
		__field(	int,	cpu			)
		__field(	int,	cpu			)
@@ -509,6 +509,7 @@ TRACE_EVENT(sched_load_to_gov,
		__field(	u64,	grp_nt_ps		)
		__field(	u64,	grp_nt_ps		)
		__field(	u64,	pl			)
		__field(	u64,	pl			)
		__field(	u64,    load			)
		__field(	u64,    load			)
		__field(	int,    big_task_rotation	)
	),
	),


	TP_fast_assign(
	TP_fast_assign(
@@ -524,12 +525,14 @@ TRACE_EVENT(sched_load_to_gov,
		__entry->grp_nt_ps	= rq->grp_time.nt_prev_runnable_sum;
		__entry->grp_nt_ps	= rq->grp_time.nt_prev_runnable_sum;
		__entry->pl		= rq->walt_stats.pred_demands_sum;
		__entry->pl		= rq->walt_stats.pred_demands_sum;
		__entry->load		= load;
		__entry->load		= load;
		__entry->big_task_rotation = big_task_rotation;
	),
	),


	TP_printk("cpu=%d policy=%d ed_task_pid=%d aggr_grp_load=%llu freq_aggr_thresh=%llu tt_load=%llu rq_ps=%llu grp_rq_ps=%llu nt_ps=%llu grp_nt_ps=%llu pl=%llu load=%llu",
	TP_printk("cpu=%d policy=%d ed_task_pid=%d aggr_grp_load=%llu freq_aggr_thresh=%llu tt_load=%llu rq_ps=%llu grp_rq_ps=%llu nt_ps=%llu grp_nt_ps=%llu pl=%llu load=%llu big_task_rotation=%d",
		__entry->cpu, __entry->policy, __entry->ed_task_pid,
		__entry->cpu, __entry->policy, __entry->ed_task_pid,
		__entry->aggr_grp_load, __entry->freq_aggr_thresh,
		__entry->aggr_grp_load, __entry->freq_aggr_thresh,
		__entry->tt_load, __entry->rq_ps, __entry->grp_rq_ps,
		__entry->tt_load, __entry->rq_ps, __entry->grp_rq_ps,
		__entry->nt_ps, __entry->grp_nt_ps, __entry->pl, __entry->load)
		__entry->nt_ps, __entry->grp_nt_ps, __entry->pl, __entry->load,
		__entry->big_task_rotation)
);
);
#endif
#endif
+1 −0
Original line number Original line Diff line number Diff line
@@ -767,6 +767,7 @@ static inline void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
		sched_info_queued(rq, p);
		sched_info_queued(rq, p);


	p->sched_class->enqueue_task(rq, p, flags);
	p->sched_class->enqueue_task(rq, p, flags);
	walt_update_last_enqueue(p);
}
}


static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
+1 −0
Original line number Original line Diff line number Diff line
@@ -479,6 +479,7 @@ static void update_running_avg(void)


	sched_get_nr_running_avg(&avg, &iowait_avg, &big_avg,
	sched_get_nr_running_avg(&avg, &iowait_avg, &big_avg,
				 &max_nr, &big_max_nr);
				 &max_nr, &big_max_nr);
	walt_rotation_checkpoint(big_avg);


	spin_lock_irqsave(&state_lock, flags);
	spin_lock_irqsave(&state_lock, flags);
	for_each_cluster(cluster, index) {
	for_each_cluster(cluster, index) {
Loading