From: Nikhil Rao on
sd->balance_interval is updated incorrectly when SD_BALANCE_NEWIDLE is not set
in sd->flags. This patch updates sd->balance_interval only when we balance the
domain.

Signed-off-by: Nikhil Rao <ncrao(a)google.com>
---
kernel/sched_fair.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 217e4a9..c35fe47 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -2996,11 +2996,12 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
if (!(sd->flags & SD_LOAD_BALANCE))
continue;

- if (sd->flags & SD_BALANCE_NEWIDLE) {
- /* If we've pulled tasks over stop searching: */
- pulled_task = load_balance(this_cpu, this_rq,
- sd, CPU_NEWLY_IDLE, &balance);
- }
+ if (!(sd->flags & SD_BALANCE_NEWIDLE))
+ continue;
+
+ /* If we've pulled tasks over stop searching: */
+ pulled_task = load_balance(this_cpu, this_rq, sd,
+ CPU_NEWLY_IDLE, &balance);

interval = msecs_to_jiffies(sd->balance_interval);
if (time_after(next_balance, sd->last_balance + interval))
--
1.7.0.1

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