In power balance, we hope some sched groups are fully empty to save
CPU power of them. So, we want to move any tasks from them.

Signed-off-by: Alex Shi <alex....@intel.com>
---
 kernel/sched/fair.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0047856..f3abb83 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5125,7 +5125,9 @@ 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 (rq->nr_running == 0 ||
+                       (!env->power_lb && capacity &&
+                               rq->nr_running == 1 && wl > env->imbalance))
                        continue;
 
                /*
@@ -5229,7 +5231,8 @@ redo:
 
        ld_moved = 0;
        lb_iterations = 1;
-       if (busiest->nr_running > 1) {
+       if (busiest->nr_running > 1 ||
+               (busiest->nr_running == 1 && env.power_lb)) {
                /*
                 * Attempt to move tasks. If find_busiest_group has found
                 * an imbalance but busiest->nr_running <= 1, the group is
-- 
1.7.12

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

Reply via email to