Revert "ANDROID: sched/fair: Bias EAS placement for latency"
This reverts commit 760b82c9b8. It causes
merge issues with 5.18-rc1 and has to be reverted for now. If it is
still needed, it can be added back after 5.18-rc1.
Bug: 120440300
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6e1cbec842188fe19a5eb27bf12c779fae3a1e8f
This commit is contained in:
+2
-37
@@ -6776,13 +6776,8 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
{
|
||||
unsigned long prev_delta = ULONG_MAX, best_delta = ULONG_MAX;
|
||||
struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
|
||||
int max_spare_cap_cpu_ls = prev_cpu, best_idle_cpu = -1;
|
||||
int cpu, best_energy_cpu = prev_cpu, target = -1;
|
||||
unsigned long max_spare_cap_ls = 0, target_cap;
|
||||
unsigned long cpu_cap, util, base_energy = 0;
|
||||
bool boosted, latency_sensitive = false;
|
||||
unsigned int min_exit_lat = UINT_MAX;
|
||||
struct cpuidle_state *idle;
|
||||
struct sched_domain *sd;
|
||||
struct perf_domain *pd;
|
||||
int new_cpu = INT_MAX;
|
||||
@@ -6820,10 +6815,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
if (!task_util_est(p))
|
||||
goto unlock;
|
||||
|
||||
latency_sensitive = uclamp_latency_sensitive(p);
|
||||
boosted = uclamp_boosted(p);
|
||||
target_cap = boosted ? 0 : ULONG_MAX;
|
||||
|
||||
for (; pd; pd = pd->next) {
|
||||
unsigned long cur_delta, spare_cap, max_spare_cap = 0;
|
||||
bool compute_prev_delta = false;
|
||||
@@ -6850,7 +6841,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
if (!fits_capacity(util, cpu_cap))
|
||||
continue;
|
||||
|
||||
if (!latency_sensitive && cpu == prev_cpu) {
|
||||
if (cpu == prev_cpu) {
|
||||
/* Always use prev_cpu as a candidate. */
|
||||
compute_prev_delta = true;
|
||||
} else if (spare_cap > max_spare_cap) {
|
||||
@@ -6861,32 +6852,9 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
max_spare_cap = spare_cap;
|
||||
max_spare_cap_cpu = cpu;
|
||||
}
|
||||
|
||||
if (!latency_sensitive)
|
||||
continue;
|
||||
|
||||
if (idle_cpu(cpu)) {
|
||||
cpu_cap = capacity_orig_of(cpu);
|
||||
if (boosted && cpu_cap < target_cap)
|
||||
continue;
|
||||
if (!boosted && cpu_cap > target_cap)
|
||||
continue;
|
||||
idle = idle_get_state(cpu_rq(cpu));
|
||||
if (idle && idle->exit_latency > min_exit_lat &&
|
||||
cpu_cap == target_cap)
|
||||
continue;
|
||||
|
||||
if (idle)
|
||||
min_exit_lat = idle->exit_latency;
|
||||
target_cap = cpu_cap;
|
||||
best_idle_cpu = cpu;
|
||||
} else if (spare_cap > max_spare_cap_ls) {
|
||||
max_spare_cap_ls = spare_cap;
|
||||
max_spare_cap_cpu_ls = cpu;
|
||||
}
|
||||
}
|
||||
|
||||
if (!latency_sensitive && max_spare_cap_cpu < 0 && !compute_prev_delta)
|
||||
if (max_spare_cap_cpu < 0 && !compute_prev_delta)
|
||||
continue;
|
||||
|
||||
/* Compute the 'base' energy of the pd, without @p */
|
||||
@@ -6916,9 +6884,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
if (latency_sensitive)
|
||||
return best_idle_cpu >= 0 ? best_idle_cpu : max_spare_cap_cpu_ls;
|
||||
|
||||
/*
|
||||
* Pick the best CPU if prev_cpu cannot be used, or if it saves at
|
||||
* least 6% of the energy used by prev_cpu.
|
||||
|
||||
Reference in New Issue
Block a user