[PATCH 6/8] sched: change find_busiest_queue to h_nr_running

From: Lei Wen
Date: Sun Aug 18 2013 - 04:27:53 EST


Since find_busiest_queue try to avoid do load balance for runqueue
which has only one cfs task and its load is above the imbalance
value calculated, we should use h_nr_running of cfs instead of
nr_running of rq.

Signed-off-by: Lei Wen <leiwen@xxxxxxxxxxx>
---
kernel/sched/fair.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e026001..3656603 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4990,7 +4990,8 @@ static struct rq *find_busiest_queue(struct lb_env *env,
* When comparing with imbalance, use weighted_cpuload()
* which is not scaled with the cpu power.
*/
- if (capacity && rq->nr_running == 1 && wl > env->imbalance)
+ if (capacity && rq->cfs.h_nr_running == 1
+ && wl > env->imbalance)
continue;

/*
--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/