From e673c734f321a2c8cecb6023387b215bafe038d8 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Mon, 22 Apr 2019 14:58:52 +0800 Subject: [PATCH] sched/fair: Avoid force newly idle load balance if have iowait task If this runqueue have iowait task and still force newly idle load balance, will make iowait task performance worse. Need to do the average idle time check if there is iowait task on this runqueue to have upcoming iowait task have enough cpu resource. Change-Id: I8e4dd440edbbd14d5170fbcf358bdaf5cc5b26e8 Signed-off-by: Maria Yu Signed-off-by: Biao Long --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3b93bff0f54d..6947e28faea6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11175,7 +11175,8 @@ int newidle_balance(struct rq *this_rq, struct rq_flags *rf) */ if (!cpu_active(this_cpu)) return 0; - if (!is_min_capacity_cpu(this_cpu) && silver_has_big_tasks()) + if (!is_min_capacity_cpu(this_cpu) && silver_has_big_tasks() + && (atomic_read(&this_rq->nr_iowait) == 0)) avg_idle = ULLONG_MAX; /* * This is OK, because current is on_cpu, which avoids it being picked