Skip to content

Commit 566b7c8

Browse files
sixtakuExactExampl
authored andcommitted
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: Maria Yu <aiquny@codeaurora.org> (cherry picked from commit b9f8fdc34eeb61fcc7c770b6277a83fd30fc7d8e)
1 parent 3466fe1 commit 566b7c8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

kernel/sched/fair.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6246,6 +6246,12 @@ static inline bool task_fits_max(struct task_struct *p, int cpu)
62466246
return __task_fits(p, cpu, 0);
62476247
}
62486248

6249+
static inline bool cpu_check_overutil_condition(int cpu,
6250+
unsigned long util)
6251+
{
6252+
return (capacity_orig_of(cpu) * 1024) < (util * capacity_margin);
6253+
}
6254+
62496255
bool __cpu_overutilized(int cpu, int delta)
62506256
{
62516257
return (capacity_orig_of(cpu) * 1024) <
@@ -7093,7 +7099,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
70937099
*/
70947100
min_capped_util = max(new_util, capacity_min_of(i));
70957101

7096-
if (new_util > capacity_orig)
7102+
if (cpu_check_overutil_condition(i, new_util))
70977103
continue;
70987104

70997105
/*

0 commit comments

Comments
 (0)