sched: Fix schedule_tail() to disable preemption
[deliverable/linux.git] / kernel / sched / core.c
index cde848149dd6de87a75f417f45d07996143bf367..b4935600cd85b7aded970f57e5fcf1e09bcc5462 100644 (file)
@@ -2309,15 +2309,14 @@ static inline void post_schedule(struct rq *rq)
 asmlinkage __visible void schedule_tail(struct task_struct *prev)
        __releases(rq->lock)
 {
-       struct rq *rq = this_rq();
+       struct rq *rq;
 
+       /* finish_task_switch() drops rq->lock and enables preemtion */
+       preempt_disable();
+       rq = this_rq();
        finish_task_switch(rq, prev);
-
-       /*
-        * FIXME: do we need to worry about rq being invalidated by the
-        * task_switch?
-        */
        post_schedule(rq);
+       preempt_enable();
 
        if (current->set_child_tid)
                put_user(task_pid_vnr(current), current->set_child_tid);
This page took 0.023373 seconds and 5 git commands to generate.