sched/walt: Remove the active task special case from wfbt()

The walt_find_best_target() has a special case for the active task
migration attempt from tick path. It tries hard to find an idle
CPU by disabling most_spare_cap_cpu selection. However this is
all unnecessary if we can check for the idle CPU condition at
the caller site. This helps the overall execution time of wfbt().

Change-Id: I89de44824dca8729b8c62898f9e75dc8e0e1c544
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
Pavankumar Kondeti 2021-02-04 17:00:14 +05:30 committed by Rishabh Bhatnagar
parent f3d3bd3f15
commit 5d231eb1a8
2 changed files with 4 additions and 12 deletions

View File

@ -196,7 +196,6 @@ static void walt_find_best_target(struct sched_domain *sd,
cpumask_t visit_cpus;
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
struct cfs_rq *cfs_rq;
bool active_task = task_on_rq_queued(p);
/* Find start CPU based on boost value */
start_cpu = fbt_env->start_cpu;
@ -215,9 +214,6 @@ static void walt_find_best_target(struct sched_domain *sd,
most_spare_wake_cap = LONG_MIN;
}
if (active_task)
most_spare_wake_cap = ULONG_MAX;
/* fast path for prev_cpu */
if (((capacity_orig_of(prev_cpu) == capacity_orig_of(start_cpu)) ||
asym_cap_siblings(prev_cpu, start_cpu)) &&
@ -338,12 +334,6 @@ static void walt_find_best_target(struct sched_domain *sd,
continue;
}
/*
* Consider only idle CPUs for active migration.
*/
if (active_task)
continue;
/*
* Try to spread the rtg high prio tasks so that they
* don't preempt each other. This is a optimisitc
@ -408,7 +398,7 @@ static void walt_find_best_target(struct sched_domain *sd,
trace_sched_find_best_target(p, min_util, start_cpu,
best_idle_cpu, most_spare_cap_cpu,
target_cpu, order_index, end_index,
fbt_env->skip_cpu, active_task);
fbt_env->skip_cpu, task_on_rq_queued(p));
}
static inline unsigned long

View File

@ -508,7 +508,9 @@ static void walt_lb_tick(void *unused, struct rq *rq)
new_cpu = walt_find_energy_efficient_cpu(p, prev_cpu, 0, 1);
rcu_read_unlock();
if (new_cpu < 0 || same_cluster(new_cpu, prev_cpu))
/* prevent active task migration to busy or same/lower capacity CPU */
if (new_cpu < 0 || !available_idle_cpu(new_cpu) ||
capacity_orig_of(new_cpu) <= capacity_orig_of(prev_cpu))
goto out_unlock;
raw_spin_lock(&rq->lock);