From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755759Ab3AEIjD (ORCPT ); Sat, 5 Jan 2013 03:39:03 -0500 Received: from mga11.intel.com ([192.55.52.93]:44979 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755108Ab3AEIhr (ORCPT ); Sat, 5 Jan 2013 03:37:47 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,415,1355126400"; d="scan'208";a="270210170" From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, akpm@linux-foundation.org, arjan@linux.intel.com, bp@alien8.de, pjt@google.com, namhyung@kernel.org, efault@gmx.de Cc: vincent.guittot@linaro.org, gregkh@linuxfoundation.org, preeti@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, alex.shi@intel.com Subject: [PATCH v3 19/22] sched: pull all tasks from source group Date: Sat, 5 Jan 2013 16:37:48 +0800 Message-Id: <1357375071-11793-20-git-send-email-alex.shi@intel.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1357375071-11793-1-git-send-email-alex.shi@intel.com> References: <1357375071-11793-1-git-send-email-alex.shi@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In power balance, we hope some sched groups are fully empty to save CPU power of them. So, we want to move all tasks from them. Signed-off-by: Alex Shi --- 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 380c8cf..d43fe6a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5109,7 +5109,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; /* @@ -5213,7 +5215,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