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

Commit dc3420d8 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

sched: EAS: check if CPU is overutilized correctly



rd->overutilized can be set when any CPU within the same sched domain
is overutlized.  But that doesn't necessarily mean 'cpu' is
overutilized and don't have spare capacity to take new task.

Use cpu_overutilized() instead of cpu_rq(cpu)->rd->overutilized.

Change-Id: I370902b52da9731630e1d59e97b03b0458cd5c49
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 449182f6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -4679,7 +4679,6 @@ static inline void hrtick_update(struct rq *rq)
#endif

#ifdef CONFIG_SMP
static bool cpu_overutilized(int cpu);
static unsigned long capacity_orig_of(int cpu);
static unsigned long cpu_util(int cpu);
static inline unsigned long boosted_cpu_util(int cpu);
@@ -5918,7 +5917,7 @@ static bool __cpu_overutilized(int cpu, int delta)
	       ((cpu_util(cpu) + delta) * capacity_margin);
}

static bool cpu_overutilized(int cpu)
bool cpu_overutilized(int cpu)
{
	return __cpu_overutilized(cpu, 0);
}
+1 −1
Original line number Diff line number Diff line
@@ -1884,7 +1884,7 @@ static int find_lowest_rq(struct task_struct *task)
			 * double count rt task load.
			 */
			util = cpu_util(cpu);
			if (!cpu_rq(cpu)->rd->overutilized) {
			if (!cpu_overutilized(cpu)) {
				if (best_cpu_util > util ||
				    (best_cpu_util == util &&
				     cpu == task_cpu(task))) {
+2 −0
Original line number Diff line number Diff line
@@ -1460,6 +1460,8 @@ extern void nohz_balance_clear_nohz_mask(int cpu);

extern void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask);

bool cpu_overutilized(int cpu);

#endif

#ifdef CONFIG_CPU_IDLE