After over tipping point if there have two big tasks are packing on single CPU, these two tasks can be easily meet the condition for task_hot(). In result can_migrate_task() returns false and will _NOT_ spread task within cluster.
This patch check extra condition if source CPU has more than two runnable tasks and destination CPU is idle, then consider tasks can be more aggressively to migrate.
Signed-off-by: Leo Yan leo.yan@linaro.org --- kernel/sched/fair.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7fbfd41..a6eef88 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6541,6 +6541,17 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) return 1; }
+ /* + * After over tipping point then aggressively to spread task + * to CPUs if destination CPU is idle and source CPU has more than + * one task is runnable. + */ + if (energy_aware() && env->dst_rq->rd->overutilized) { + if (env->dst_rq->nr_running == 0 && + env->src_rq->nr_running >= 2) + return 1; + } + schedstat_inc(p, se.statistics.nr_failed_migrations_hot); return 0; } -- 1.9.1