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

Commit 1c847afb authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Todd Kjos
Browse files

ANDROID: sched: WALT: Refactor cumulative runnable average fixup



When a runnable task window is rolled over, it's CPU cumulative
runnable average needs to be updated accordingly. Currently this
is handled in a common function for all scheduling classes. However
when CFS_BANDWIDTH is enabled, fair scheduling class needs special
handling. As a preparation step, add a callback in sched_class
for updating the cumulative runnable average. The subsequent patches
make use of this callback and implement a different method for
fair scheduling class.

Bug: 139071966
Change-Id: Iffa88ab89254932177b1ea4eeaf12ec305c1c9c6
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: default avatarTodd Kjos <tkjos@google.com>
parent 5e36f63b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1937,6 +1937,9 @@ const struct sched_class dl_sched_class = {
	.switched_to		= switched_to_dl,

	.update_curr		= update_curr_dl,
#ifdef CONFIG_SCHED_WALT
	.fixup_cumulative_runnable_avg = walt_fixup_cumulative_runnable_avg,
#endif
};

#ifdef CONFIG_SCHED_DEBUG
+3 −0
Original line number Diff line number Diff line
@@ -11000,6 +11000,9 @@ const struct sched_class fair_sched_class = {
#ifdef CONFIG_FAIR_GROUP_SCHED
	.task_change_group	= task_change_group_fair,
#endif
#ifdef CONFIG_SCHED_WALT
	.fixup_cumulative_runnable_avg = walt_fixup_cumulative_runnable_avg,
#endif
};

#ifdef CONFIG_SCHED_DEBUG
+3 −0
Original line number Diff line number Diff line
@@ -2419,6 +2419,9 @@ const struct sched_class rt_sched_class = {
	.switched_to		= switched_to_rt,

	.update_curr		= update_curr_rt,
#ifdef CONFIG_SCHED_WALT
	.fixup_cumulative_runnable_avg = walt_fixup_cumulative_runnable_avg,
#endif
};

#ifdef CONFIG_SCHED_DEBUG
+5 −0
Original line number Diff line number Diff line
@@ -1453,6 +1453,11 @@ struct sched_class {
#ifdef CONFIG_FAIR_GROUP_SCHED
	void (*task_change_group) (struct task_struct *p, int type);
#endif
#ifdef CONFIG_SCHED_WALT
	void (*fixup_cumulative_runnable_avg)(struct rq *rq,
					      struct task_struct *task,
					      u64 new_task_load);
#endif
};

static inline void put_prev_task(struct rq *rq, struct task_struct *prev)
+3 −0
Original line number Diff line number Diff line
@@ -137,4 +137,7 @@ const struct sched_class stop_sched_class = {
	.prio_changed		= prio_changed_stop,
	.switched_to		= switched_to_stop,
	.update_curr		= update_curr_stop,
#ifdef CONFIG_SCHED_WALT
	.fixup_cumulative_runnable_avg = walt_fixup_cumulative_runnable_avg,
#endif
};
Loading