Commit e4aa358b authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Ingo Molnar

sched/fair: Push down check for high priority class task into idle_balance()

We close idle_exit_fair() bracket in case of we've pulled something or we've received
task of high priority class.
Signed-off-by: default avatarKirill Tkhai <ktkhai@parallels.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: http://lkml.kernel.org/r/1394098315.19290.10.camel@tkhaiSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 734ff2a7
...@@ -4787,17 +4787,16 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev) ...@@ -4787,17 +4787,16 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev)
return p; return p;
idle: idle:
new_tasks = idle_balance(rq);
/* /*
* Because idle_balance() releases (and re-acquires) rq->lock, it is * Because idle_balance() releases (and re-acquires) rq->lock, it is
* possible for any higher priority task to appear. In that case we * possible for any higher priority task to appear. In that case we
* must re-start the pick_next_entity() loop. * must re-start the pick_next_entity() loop.
*/ */
new_tasks = idle_balance(rq); if (new_tasks < 0)
if (rq->nr_running != rq->cfs.h_nr_running)
return RETRY_TASK; return RETRY_TASK;
if (new_tasks) if (new_tasks > 0)
goto again; goto again;
return NULL; return NULL;
...@@ -6728,8 +6727,14 @@ static int idle_balance(struct rq *this_rq) ...@@ -6728,8 +6727,14 @@ static int idle_balance(struct rq *this_rq)
this_rq->max_idle_balance_cost = curr_cost; this_rq->max_idle_balance_cost = curr_cost;
out: out:
if (pulled_task) /* Is there a task of a high priority class? */
if (this_rq->nr_running != this_rq->cfs.h_nr_running)
pulled_task = -1;
if (pulled_task) {
idle_exit_fair(this_rq);
this_rq->idle_stamp = 0; this_rq->idle_stamp = 0;
}
return pulled_task; return pulled_task;
} }
......
...@@ -29,7 +29,6 @@ pick_next_task_idle(struct rq *rq, struct task_struct *prev) ...@@ -29,7 +29,6 @@ pick_next_task_idle(struct rq *rq, struct task_struct *prev)
put_prev_task(rq, prev); put_prev_task(rq, prev);
schedstat_inc(rq, sched_goidle); schedstat_inc(rq, sched_goidle);
idle_enter_fair(rq);
return rq->idle; return rq->idle;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment