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

Skip to content
Commit 5eb2fa0b authored by Yi Yao's avatar Yi Yao
Browse files

ANDROID: sched/fair: fix logic error in wake_cap



Google kernel 4.14 update commit a47662b5
"ANDROID: sched: Add group_misfit_task load-balance type"
changes the original logic:

+static inline int task_fits_capacity(struct task_struct *p, long capacity)
+{
+       return capacity * 1024 > task_util(p) * capacity_margin;
+}
+
/*
 * Disable WAKE_AFFINE in the case where task @p doesn't fit in the
 * capacity of either the waking CPU @cpu or the previous CPU @prev_cpu.
@@ -5922,7 +5927,7 @@ static int wake_cap(struct task_struct *p, int cpu, int prev_cpu)
        /* Bring task utilization in sync with prev_cpu */
        sync_entity_load_avg(&p->se);

-       return min_cap * 1024 < task_util(p) * capacity_margin;
+       return task_fits_capacity(p, min_cap);
}

It makes the judgement logic completely opposite and it is not correct.
Restore the logic as same as before.

Test: manual test
Change-Id: I909cf9551f00c7709c7f20f3a526c18d56fc11b1
Signed-off-by: default avatarYi Yao <yi.yao@intel.com>
parent b479cddd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment