]> err.no Git - linux-2.6/commitdiff
sched: fix new task startup crash
authorSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Wed, 17 Oct 2007 14:55:11 +0000 (16:55 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 17 Oct 2007 14:55:11 +0000 (16:55 +0200)
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>
kernel/sched.c
kernel/sched_fair.c

index 975436435b4276d3d8a90aa16a8c9cbe7bb93fa7..0ec9521a8e704a456057981a67abe03ce13d86f1 100644 (file)
@@ -1712,7 +1712,7 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 
        p->prio = effective_prio(p);
 
-       if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
+       if (!p->sched_class->task_new || !current->se.on_rq) {
                activate_task(rq, p, 0);
        } else {
                /*
index a17b785d7000cd876045cae3e9c1fdba1f39ce9e..166ed6db600b03490866661f107fa386d10fa181 100644 (file)
@@ -1031,12 +1031,8 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
                swap(curr->vruntime, se->vruntime);
        }
 
-       update_stats_enqueue(cfs_rq, se);
-       check_spread(cfs_rq, se);
-       check_spread(cfs_rq, curr);
-       __enqueue_entity(cfs_rq, se);
-       account_entity_enqueue(cfs_rq, se);
        se->peer_preempt = 0;
+       enqueue_task_fair(rq, p, 0);
        resched_task(rq->curr);
 }