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

Commit 999b62ac authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched: Use capacity_orig_of instead of capacity_of in overutilized function



At present __cpu_overutilized() determines whether CPU is overutilized
or not by using capacity_of(). CPU's capacity can be reduced by RT tasks
load and using capacity_of() may lead to undesired behavior. So, use
capacity_orig_of() instead of capacity_of() to find CPU is overutilized
or not.

While at it, remove double accounting of cpu utilization for RT tasks.

Change-Id: I55b1a782f5b4ad859ee88cd43d5236b8187db2ea
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent c60b52df
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6155,7 +6155,8 @@ static inline bool task_fits_max(struct task_struct *p, int cpu)

bool __cpu_overutilized(int cpu, int delta)
{
	return (capacity_of(cpu) * 1024) < ((cpu_util(cpu) + delta) * capacity_margin);
	return (capacity_orig_of(cpu) * 1024) <
			((cpu_util(cpu) + delta) * capacity_margin);
}

bool cpu_overutilized(int cpu)
+1 −1
Original line number Diff line number Diff line
@@ -1834,7 +1834,7 @@ static int find_lowest_rq(struct task_struct *task)
			if (avoid_prev_cpu && cpu == prev_cpu)
				continue;

			if (__cpu_overutilized(cpu, util + tutil))
			if (__cpu_overutilized(cpu, tutil))
				continue;

			if (cpu_isolated(cpu))