]> Pileus Git - ~andy/linux/blobdiff - kernel/sched.c
sched: clean up sched_fork()
[~andy/linux] / kernel / sched.c
index 36484da963f96464d96105512d3c23d8597679ef..cd2b4942fe353cf528ddbfe2168c5adbb9ccf05a 100644 (file)
@@ -1663,6 +1663,8 @@ void sched_fork(struct task_struct *p, int clone_flags)
         * Make sure we do not leak PI boosting priority to the child:
         */
        p->prio = current->normal_prio;
+       if (!rt_prio(p->prio))
+               p->sched_class = &fair_sched_class;
 
 #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
        if (likely(sched_info_on()))
@@ -1698,11 +1700,6 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 
        p->prio = effective_prio(p);
 
-       if (rt_prio(p->prio))
-               p->sched_class = &rt_sched_class;
-       else
-               p->sched_class = &fair_sched_class;
-
        if (task_cpu(p) != this_cpu || !p->sched_class->task_new ||
                                                        !current->se.on_rq) {
                activate_task(rq, p, 0);