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

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: default avatarKirill Tkhai <tkhai@yandex.ru>
Cc: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/336561397137116@web27h.yandex.ruSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 60e69eed
...@@ -1021,8 +1021,17 @@ struct task_struct *pick_next_task_dl(struct rq *rq, struct task_struct *prev) ...@@ -1021,8 +1021,17 @@ struct task_struct *pick_next_task_dl(struct rq *rq, struct task_struct *prev)
dl_rq = &rq->dl; dl_rq = &rq->dl;
if (need_pull_dl_task(rq, prev)) if (need_pull_dl_task(rq, prev)) {
pull_dl_task(rq); pull_dl_task(rq);
/*
* pull_rt_task() can drop (and re-acquire) rq->lock; this
* means a stop task can slip in, in which case we need to
* re-start task selection.
*/
if (rq->stop && rq->stop->on_rq)
return RETRY_TASK;
}
/* /*
* When prev is DL, we may throttle it in put_prev_task(). * When prev is DL, we may throttle it in put_prev_task().
* So, we update time before we check for dl_nr_running. * So, we update time before we check for dl_nr_running.
......
...@@ -6728,7 +6728,8 @@ static int idle_balance(struct rq *this_rq) ...@@ -6728,7 +6728,8 @@ static int idle_balance(struct rq *this_rq)
out: out:
/* Is there a task of a high priority class? */ /* Is there a task of a high priority class? */
if (this_rq->nr_running != this_rq->cfs.h_nr_running && if (this_rq->nr_running != this_rq->cfs.h_nr_running &&
(this_rq->dl.dl_nr_running || ((this_rq->stop && this_rq->stop->on_rq) ||
this_rq->dl.dl_nr_running ||
(this_rq->rt.rt_nr_running && !rt_rq_throttled(&this_rq->rt)))) (this_rq->rt.rt_nr_running && !rt_rq_throttled(&this_rq->rt))))
pulled_task = -1; pulled_task = -1;
......
...@@ -1362,10 +1362,11 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev) ...@@ -1362,10 +1362,11 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev)
pull_rt_task(rq); pull_rt_task(rq);
/* /*
* pull_rt_task() can drop (and re-acquire) rq->lock; this * pull_rt_task() can drop (and re-acquire) rq->lock; this
* means a dl task can slip in, in which case we need to * means a dl or stop task can slip in, in which case we need
* re-start task selection. * to re-start task selection.
*/ */
if (unlikely(rq->dl.dl_nr_running)) if (unlikely((rq->stop && rq->stop->on_rq) ||
rq->dl.dl_nr_running))
return RETRY_TASK; return RETRY_TASK;
} }
......
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