sched: core: Skip migrating tasks that aren't enqueued on dead_rq

During migrate_tasks, we have to drop the dead_rq lock in
order to preserve locking order when acquiring task->pi_lock.
This may allow the task to migrate off of dead_rq. Therefore,
don't attempt to migrate such a task again from dead_rq.

Change-Id: Id31b58e231d3dcd7d32e0dc7f264595d60a7c408
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This commit is contained in:
Vikram Mulukutla 2016-11-11 16:05:24 -08:00
parent 45b8775b62
commit 3f11a4bc4f

View file

@ -5537,8 +5537,8 @@ static void migrate_tasks(struct rq *dead_rq, bool migrate_pinned_tasks)
* interferred since we don't stop all CPUs. Ignore warning for
* this case.
*/
if (WARN_ON((task_rq(next) != rq || !task_on_rq_queued(next)) &&
migrate_pinned_tasks)) {
if (task_rq(next) != rq || !task_on_rq_queued(next)) {
WARN_ON(migrate_pinned_tasks);
raw_spin_unlock(&next->pi_lock);
continue;
}