|
@@ -2294,7 +2294,6 @@ static inline void init_schedstats(void) {}
|
|
|
int sched_fork(unsigned long clone_flags, struct task_struct *p)
|
|
|
{
|
|
|
unsigned long flags;
|
|
|
- int cpu = get_cpu();
|
|
|
|
|
|
__sched_fork(clone_flags, p);
|
|
|
/*
|
|
@@ -2330,14 +2329,12 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
|
|
|
p->sched_reset_on_fork = 0;
|
|
|
}
|
|
|
|
|
|
- if (dl_prio(p->prio)) {
|
|
|
- put_cpu();
|
|
|
+ if (dl_prio(p->prio))
|
|
|
return -EAGAIN;
|
|
|
- } else if (rt_prio(p->prio)) {
|
|
|
+ else if (rt_prio(p->prio))
|
|
|
p->sched_class = &rt_sched_class;
|
|
|
- } else {
|
|
|
+ else
|
|
|
p->sched_class = &fair_sched_class;
|
|
|
- }
|
|
|
|
|
|
init_entity_runnable_average(&p->se);
|
|
|
|
|
@@ -2353,7 +2350,7 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
|
|
|
* We're setting the CPU for the first time, we don't migrate,
|
|
|
* so use __set_task_cpu().
|
|
|
*/
|
|
|
- __set_task_cpu(p, cpu);
|
|
|
+ __set_task_cpu(p, smp_processor_id());
|
|
|
if (p->sched_class->task_fork)
|
|
|
p->sched_class->task_fork(p);
|
|
|
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
|
@@ -2370,8 +2367,6 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
|
|
|
plist_node_init(&p->pushable_tasks, MAX_PRIO);
|
|
|
RB_CLEAR_NODE(&p->pushable_dl_tasks);
|
|
|
#endif
|
|
|
-
|
|
|
- put_cpu();
|
|
|
return 0;
|
|
|
}
|
|
|
|