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:Yi Yao <yi.yao@intel.com>
Loading
Please register or sign in to comment