aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorKirill Tkhai <ktkhai@parallels.com>2014-03-06 04:31:55 -0500
committerIngo Molnar <mingo@kernel.org>2014-03-11 07:05:37 -0400
commite4aa358b6c23f98b2715594f6b1e9a4996a55f04 (patch)
tree6e3de5eaeccde610cf01ec06994b587084104a8b /kernel/sched/fair.c
parent734ff2a71f9e6aa6fedfa5a9a34818b8586516d5 (diff)
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: Kirill Tkhai <ktkhai@parallels.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Vincent Guittot <vincent.guittot@linaro.org> Link: http://lkml.kernel.org/r/1394098315.19290.10.camel@tkhai Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d8482e1c575e..b956e70fc503 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4787,17 +4787,16 @@ simple:
4787 return p; 4787 return p;
4788 4788
4789idle: 4789idle:
4790 new_tasks = idle_balance(rq);
4790 /* 4791 /*
4791 * Because idle_balance() releases (and re-acquires) rq->lock, it is 4792 * Because idle_balance() releases (and re-acquires) rq->lock, it is
4792 * possible for any higher priority task to appear. In that case we 4793 * possible for any higher priority task to appear. In that case we
4793 * must re-start the pick_next_entity() loop. 4794 * must re-start the pick_next_entity() loop.
4794 */ 4795 */
4795 new_tasks = idle_balance(rq); 4796 if (new_tasks < 0)
4796
4797 if (rq->nr_running != rq->cfs.h_nr_running)
4798 return RETRY_TASK; 4797 return RETRY_TASK;
4799 4798
4800 if (new_tasks) 4799 if (new_tasks > 0)
4801 goto again; 4800 goto again;
4802 4801
4803 return NULL; 4802 return NULL;
@@ -6728,8 +6727,14 @@ static int idle_balance(struct rq *this_rq)
6728 this_rq->max_idle_balance_cost = curr_cost; 6727 this_rq->max_idle_balance_cost = curr_cost;
6729 6728
6730out: 6729out:
6731 if (pulled_task) 6730 /* Is there a task of a high priority class? */
6731 if (this_rq->nr_running != this_rq->cfs.h_nr_running)
6732 pulled_task = -1;
6733
6734 if (pulled_task) {
6735 idle_exit_fair(this_rq);
6732 this_rq->idle_stamp = 0; 6736 this_rq->idle_stamp = 0;
6737 }
6733 6738
6734 return pulled_task; 6739 return pulled_task;
6735} 6740}