Commit 861d034e authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched: Fix rq->clock synchronization when migrating tasks

sched_fork() -- we do task placement in ->task_fork_fair() ensure we
  update_rq_clock() so we work with current time. We leave the vruntime
  in relative state, so the time delay until wake_up_new_task() doesn't
  matter.

wake_up_new_task() -- Since task_fork_fair() left p->vruntime in
  relative state we can safely migrate, the activate_task() on the
  remote rq will call update_rq_clock() and causes the clock to be
  synced (enough).
Tested-by: default avatarJack Daniel <wanders.thirst@gmail.com>
Tested-by: default avatarPhilby John <pjohn@mvista.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1281002322.1923.1708.camel@laptop>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 763008c4
...@@ -3752,6 +3752,8 @@ static void task_fork_fair(struct task_struct *p) ...@@ -3752,6 +3752,8 @@ static void task_fork_fair(struct task_struct *p)
raw_spin_lock_irqsave(&rq->lock, flags); raw_spin_lock_irqsave(&rq->lock, flags);
update_rq_clock(rq);
if (unlikely(task_cpu(p) != this_cpu)) if (unlikely(task_cpu(p) != this_cpu))
__set_task_cpu(p, this_cpu); __set_task_cpu(p, this_cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment