From dc626b28ee7cf9269eaadc512a2c497acfae0109 Mon Sep 17 00:00:00 2001 From: Prasad Sodagudi Date: Sat, 5 Jul 2014 13:08:54 +0530 Subject: [PATCH] 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 [rameezmustafa@codeaurora.org]: Port to msm-3.18] Signed-off-by: Syed Rameez Mustafa Signed-off-by: Vikram Mulukutla --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 716aa3495b63..8ffebf95a522 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9463,7 +9463,8 @@ static int active_load_balance_cpu_stop(void *data) push_task = busiest_rq->push_task; if (push_task) { if (task_on_rq_queued(push_task) && - task_cpu(push_task) == busiest_cpu) { + task_cpu(push_task) == busiest_cpu && + cpu_online(target_cpu)) { detach_task(push_task, &env); push_task_detached = 1; }