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

Commit c28f0390 authored by Maria Yu's avatar Maria Yu
Browse files

sched/fair: Consider others if target cpu overutilized



If target cpu overutilized, it's better to consider
other group cpu. It can avoid unnecessary waiting on
overutilized cpu and wait until load balance for task
to be run.

Change-Id: I6f8bccb611d2f11471254cf2795fb5bf3f122292
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 86979a83
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -6213,6 +6213,12 @@ static inline bool task_fits_max(struct task_struct *p, int cpu)
	return __task_fits(p, cpu, 0);
}

static inline bool cpu_check_overutil_condition(int cpu,
						unsigned long util)
{
	return (capacity_orig_of(cpu) * 1024) < (util * capacity_margin);
}

bool __cpu_overutilized(int cpu, int delta)
{
	return (capacity_orig_of(cpu) * 1024) <
@@ -7062,7 +7068,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
			 */
			min_capped_util = max(new_util, capacity_min_of(i));

			if (new_util > capacity_orig)
			if (cpu_check_overutil_condition(i, new_util))
				continue;

			/*