sched: Ensure proper task migration when a CPU is isolated
migrate_tasks() migrates all tasks of a CPU by using pick_next_task(). This works in the hotplug case as we force migrate every single task allowing pick_next_task() to return a new task on every loop iteration. In the case of isolation, however, task migration is not guaranteed which causes pick_next_task() to keep returning the same task over and over again until we terminate the loop without having migrated all the tasks that were supposed to migrated. Fix the above problem by temporarily dequeuing tasks that are pinned and marking them with TASK_ON_RQ_MIGRATING. This not only allows pick_next_task() to properly walk the runqueue but also prevents any migrations or changes in affinity for the dequeued tasks. Once we are done with migrating all possible tasks, we re-enqueue all the dequeued tasks. While at it, ensure consistent ordering between task de-activation and setting the TASK_ON_RQ_MIGRATING flag across all scheduling classes. Change-Id: Ia6f8aea264e441ff9a8e3ce85828ac2d7a9a1781 Signed-off-by:Syed Rameez Mustafa <rameezmustafa@codeaurora.org> [markivx: Fix minor comment conflict] Signed-off-by:
Vikram Mulukutla <markivx@codeaurora.org> Signed-off-by:
Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Loading
Please register or sign in to comment