Skip to content

Commit b03fa7f

Browse files
Prasad Sodagudipundiramit
authored andcommitted
sched: avoid pushing tasks to an offline CPU
Currently active_load_balance_cpu_stop is run by cpu stopper and it pushes running tasks off the busiest CPU onto idle target CPU. But there is no check to see whether target cpu is offline or not before pushing the tasks. With the introduction of active migration in the scheduler tick path (see check_for_migration()) there have been instances of attempts to migrate tasks to offline CPUs. Add a check as to whether the target cpu is online or not to prevent scheduling on offline CPUs. Change-Id: Ib8ac7f8aeabd3ca7365f3eae977075952dab4f21 Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org> [rameezmustafa@codeaurora.org]: Port to msm-3.18] Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org> Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
1 parent a80b8c7 commit b03fa7f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/sched/fair.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9463,7 +9463,8 @@ static int active_load_balance_cpu_stop(void *data)
94639463
push_task = busiest_rq->push_task;
94649464
if (push_task) {
94659465
if (task_on_rq_queued(push_task) &&
9466-
task_cpu(push_task) == busiest_cpu) {
9466+
task_cpu(push_task) == busiest_cpu &&
9467+
cpu_online(target_cpu)) {
94679468
detach_task(push_task, &env);
94689469
push_task_detached = 1;
94699470
}

0 commit comments

Comments
 (0)