aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-10-15 11:00:14 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-15 11:00:14 -0400
commit00bf7bfc2eaf775b634774e9ec435d720b6ecee7 (patch)
tree1f816516361276a56b9dee6b39e90361dc3468be /kernel/sched.c
parent0702e3ebc1e42576a04d29f8adacf13be825b800 (diff)
sched: fix: move the CPU check into ->task_new_fair()
noticed by Peter Zijlstra: fix: move the CPU check into ->task_new_fair(), this way we can call place_entity() and get child ->vruntime right at initial wakeup time. (without this there can be large latencies) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f2b8db4d6802..b41ef663b993 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1660,17 +1660,14 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
1660{ 1660{
1661 unsigned long flags; 1661 unsigned long flags;
1662 struct rq *rq; 1662 struct rq *rq;
1663 int this_cpu;
1664 1663
1665 rq = task_rq_lock(p, &flags); 1664 rq = task_rq_lock(p, &flags);
1666 BUG_ON(p->state != TASK_RUNNING); 1665 BUG_ON(p->state != TASK_RUNNING);
1667 this_cpu = smp_processor_id(); /* parent's CPU */
1668 update_rq_clock(rq); 1666 update_rq_clock(rq);
1669 1667
1670 p->prio = effective_prio(p); 1668 p->prio = effective_prio(p);
1671 1669
1672 if (task_cpu(p) != this_cpu || !p->sched_class->task_new || 1670 if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
1673 !current->se.on_rq) {
1674 activate_task(rq, p, 0); 1671 activate_task(rq, p, 0);
1675 } else { 1672 } else {
1676 /* 1673 /*