sched/walt: Improve the scheduler

This change is for general scheduler improvement.

Change-Id: I616acbe5bfdb0e1bf88e923d98b4a3d54d26d942
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
Pavankumar Kondeti 2021-01-22 07:57:10 +05:30 committed by Rishabh Bhatnagar
parent 915ef0bd8b
commit 07efb5ada9
4 changed files with 8 additions and 2 deletions

View File

@ -2187,6 +2187,8 @@ static void walt_update_task_ravg(struct task_struct *p, struct rq *rq, int even
update_task_demand(p, rq, event, wallclock);
update_cpu_busy_time(p, rq, event, wallclock, irqtime);
update_task_pred_demand(rq, p, event);
if (event == PUT_PREV_TASK && p->state)
wts->iowaited = p->in_iowait;
trace_sched_update_task_ravg(p, rq, event, wallclock, irqtime,
&wrq->grp_time, wrq, wts);
@ -4047,6 +4049,7 @@ static void android_rvh_sched_fork_init(void *unused, struct task_struct *p)
wts->boost_expires = 0;
wts->boost_period = false;
wts->low_latency = false;
wts->iowaited = false;
}
static void android_rvh_ttwu_cond(void *unused, bool *cond)

View File

@ -132,6 +132,7 @@ struct walt_task_struct {
struct list_head grp_list;
u64 cpu_cycles;
cpumask_t cpus_requested;
bool iowaited;
};
/*End linux/sched.h port */

View File

@ -213,7 +213,8 @@ static void walt_find_best_target(struct sched_domain *sd,
unsigned int target_nr_rtg_high_prio = UINT_MAX;
bool rtg_high_prio_task = task_rtg_high_prio(p);
cpumask_t visit_cpus;
bool io_task_pack = (order_index > 0 && p->in_iowait);
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
bool io_task_pack = (order_index > 0 && wts->iowaited);
struct cfs_rq *cfs_rq;
/* Find start CPU based on boost value */

View File

@ -210,9 +210,10 @@ static inline bool _walt_can_migrate_task(struct task_struct *p, int dst_cpu,
bool to_lower)
{
struct walt_rq *wrq = (struct walt_rq *) task_rq(p)->android_vendor_data1;
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
if (to_lower) {
if (p->in_iowait)
if (wts->iowaited)
return false;
if (per_task_boost(p) == TASK_BOOST_STRICT_MAX &&
task_in_related_thread_group(p))