Skip to contentSkip to conversation

sched: fix updating sd->balance_interval in idle_balance()

PATCH In review Nikhil Rao 2 participants 2 messages May 19, 2010 – May 20, 2010

lore
Share & tools
lore

Nikhil Rao

author
#0 lore raw

PATCH 1/1 sched: fix updating sd->balance_interval in idle_balance()

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.

---
 kernel/sched_fair.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
kernel/sched_fair.c +6 -5
index 217e4a9..c35fe47 100644
@@ -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))
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 3 lines · Nikhil Rao

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.

I really need more than that.

Why is it wrong, what are the (measurable) effects of changing it and how did it come to be this way.

I could of course go and try to reverse engineer your patch, but it would be awesome if I didn't have to.