This patch series is to improve load balance with more proper behaviour for misfit task. Current code introduces type 'group_misfit_task' to indicate one schedule group has misfit task, but before the misfit task can be really migrated onto higher capacity CPU there still have some barriers we need clear up.
The first patch is to correct task_fits_max() so it can properly filter out misfit task on low capacity CPU. If without this patch, in system it's possible this function can always return true so the 'misfit' task mechanism will totally not be triggered.
The second patch is to fix function group_smaller_cpu_capacity(), so we can make sure the schedule group with type 'group_misfit_task' will not wrongly be roll back to type 'group_other'. This will let all misfit related info be abondoned.
The third patch is to fix nr_running accounting, if without this patch the scheduler will wronly consider the destination CPU has running task and skip migrate task on it. This patch is to give correct info like the destination CPU has no running task on it when the CPU is going into idle state, so should migrate misfit task by utilizing this time balance.
The forth patch is a temperary patch if we have not backported Vincent's patches "sched: reflect sched_entity move into task_group's load" [1], If without this patch series, it's possible that the CPU is not overutilized but the CPU has one misfit task has been enqueued on it. So we set sgs->group_misfit_task by checking rq->misfit_task but not rely on cpu is overutilized or not.
The fifth patch is to select busiest rq if the rq has misfit task, we let this kind rq has higher priority than the rq with highest weighted load. This criteria is only enabled for energy aware scheduling.
The sixth patch is to aggressively kick active load balance for misfit task, so it has quite high chance for higher capacity CPU to immediately pull misfit task on it.
[1] https://lkml.org/lkml/2016/10/17/223
Leo Yan (6): sched/fair: correct task_fits_max() for misfit task sched/fair: fix for group_smaller_cpu_capacity() sched/fair: fix nr_running accounting for new idle CPU sched/fair: fix to set sgs->group_misfit_task sched/fair: select busiest rq with misfit task sched/fair: kick active load balance for misfit task
kernel/sched/fair.c | 59 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 13 deletions(-)
-- 2.7.4