Commit b9dca1e0fcb696716840a3bc8f20a6941b484dbf

Authored by Srivatsa Vaddagiri
Committed by Ingo Molnar
1 parent b1a8c172c3

sched: fix new task startup crash

Child task may be added on a different cpu that the one on which parent
is running. In which case, task_new_fair() should check whether the new
born task's parent entity should be added as well on the cfs_rq.

Patch below fixes the problem in task_new_fair.

This could fix the put_prev_task_fair() crashes reported.

Reported-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Reported-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 2 changed files with 2 additions and 6 deletions Side-by-side Diff

... ... @@ -1712,7 +1712,7 @@
1712 1712  
1713 1713 p->prio = effective_prio(p);
1714 1714  
1715   - if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
  1715 + if (!p->sched_class->task_new || !current->se.on_rq) {
1716 1716 activate_task(rq, p, 0);
1717 1717 } else {
1718 1718 /*
... ... @@ -1031,12 +1031,8 @@
1031 1031 swap(curr->vruntime, se->vruntime);
1032 1032 }
1033 1033  
1034   - update_stats_enqueue(cfs_rq, se);
1035   - check_spread(cfs_rq, se);
1036   - check_spread(cfs_rq, curr);
1037   - __enqueue_entity(cfs_rq, se);
1038   - account_entity_enqueue(cfs_rq, se);
1039 1034 se->peer_preempt = 0;
  1035 + enqueue_task_fair(rq, p, 0);
1040 1036 resched_task(rq->curr);
1041 1037 }
1042 1038