|
@@ -6713,7 +6713,6 @@ static int idle_balance(struct rq *this_rq)
|
|
|
if (sd->flags & SD_BALANCE_NEWIDLE) {
|
|
|
t0 = sched_clock_cpu(this_cpu);
|
|
|
|
|
|
- /* If we've pulled tasks over stop searching: */
|
|
|
pulled_task = load_balance(this_cpu, this_rq,
|
|
|
sd, CPU_NEWLY_IDLE,
|
|
|
&continue_balancing);
|
|
@@ -6728,7 +6727,12 @@ static int idle_balance(struct rq *this_rq)
|
|
|
interval = msecs_to_jiffies(sd->balance_interval);
|
|
|
if (time_after(next_balance, sd->last_balance + interval))
|
|
|
next_balance = sd->last_balance + interval;
|
|
|
- if (pulled_task)
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Stop searching for tasks to pull if there are
|
|
|
+ * now runnable tasks on this rq.
|
|
|
+ */
|
|
|
+ if (pulled_task || this_rq->nr_running > 0)
|
|
|
break;
|
|
|
}
|
|
|
rcu_read_unlock();
|