diff options
author | Kirill Tkhai <tkhai@yandex.ru> | 2014-04-10 09:38:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-04-17 07:39:51 -0400 |
commit | a1d9a3231eac4117cadaf4b6bba5b2902c15a33e (patch) | |
tree | ea81cd4c9553b0ae0adb4357b578ba3cefc2dccf /kernel | |
parent | 60e69eed85bb7b5198ef70643b5895c26ad76ef7 (diff) |
sched: Check for stop task appearance when balancing happens
We need to do it like we do for the other higher priority classes..
Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
Cc: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/336561397137116@web27h.yandex.ru
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/deadline.c | 11 | ||||
-rw-r--r-- | kernel/sched/fair.c | 3 | ||||
-rw-r--r-- | kernel/sched/rt.c | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 27ef40925525..b08095786cb8 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c | |||
@@ -1021,8 +1021,17 @@ struct task_struct *pick_next_task_dl(struct rq *rq, struct task_struct *prev) | |||
1021 | 1021 | ||
1022 | dl_rq = &rq->dl; | 1022 | dl_rq = &rq->dl; |
1023 | 1023 | ||
1024 | if (need_pull_dl_task(rq, prev)) | 1024 | if (need_pull_dl_task(rq, prev)) { |
1025 | pull_dl_task(rq); | 1025 | pull_dl_task(rq); |
1026 | /* | ||
1027 | * pull_rt_task() can drop (and re-acquire) rq->lock; this | ||
1028 | * means a stop task can slip in, in which case we need to | ||
1029 | * re-start task selection. | ||
1030 | */ | ||
1031 | if (rq->stop && rq->stop->on_rq) | ||
1032 | return RETRY_TASK; | ||
1033 | } | ||
1034 | |||
1026 | /* | 1035 | /* |
1027 | * When prev is DL, we may throttle it in put_prev_task(). | 1036 | * When prev is DL, we may throttle it in put_prev_task(). |
1028 | * So, we update time before we check for dl_nr_running. | 1037 | * So, we update time before we check for dl_nr_running. |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4f14a656a720..7570dd969c28 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -6728,7 +6728,8 @@ static int idle_balance(struct rq *this_rq) | |||
6728 | out: | 6728 | out: |
6729 | /* Is there a task of a high priority class? */ | 6729 | /* Is there a task of a high priority class? */ |
6730 | if (this_rq->nr_running != this_rq->cfs.h_nr_running && | 6730 | if (this_rq->nr_running != this_rq->cfs.h_nr_running && |
6731 | (this_rq->dl.dl_nr_running || | 6731 | ((this_rq->stop && this_rq->stop->on_rq) || |
6732 | this_rq->dl.dl_nr_running || | ||
6732 | (this_rq->rt.rt_nr_running && !rt_rq_throttled(&this_rq->rt)))) | 6733 | (this_rq->rt.rt_nr_running && !rt_rq_throttled(&this_rq->rt)))) |
6733 | pulled_task = -1; | 6734 | pulled_task = -1; |
6734 | 6735 | ||
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index d8cdf1618551..bd2267ad404f 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
@@ -1362,10 +1362,11 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev) | |||
1362 | pull_rt_task(rq); | 1362 | pull_rt_task(rq); |
1363 | /* | 1363 | /* |
1364 | * pull_rt_task() can drop (and re-acquire) rq->lock; this | 1364 | * pull_rt_task() can drop (and re-acquire) rq->lock; this |
1365 | * means a dl task can slip in, in which case we need to | 1365 | * means a dl or stop task can slip in, in which case we need |
1366 | * re-start task selection. | 1366 | * to re-start task selection. |
1367 | */ | 1367 | */ |
1368 | if (unlikely(rq->dl.dl_nr_running)) | 1368 | if (unlikely((rq->stop && rq->stop->on_rq) || |
1369 | rq->dl.dl_nr_running)) | ||
1369 | return RETRY_TASK; | 1370 | return RETRY_TASK; |
1370 | } | 1371 | } |
1371 | 1372 | ||