diff options
author | Peter Zijlstra <peterz@infradead.org> | 2010-08-19 07:31:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-08-20 08:59:01 -0400 |
commit | 861d034ee814917a83bd5de4b26e3b8336ddeeb8 (patch) | |
tree | 6514cb3ebbb58fb0a638e267dfd6da510a5c8a00 /kernel | |
parent | 763008c4357b73c8d18396dfd8d79dc58fa3f99d (diff) |
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: Jack Daniel <wanders.thirst@gmail.com>
Tested-by: Philby John <pjohn@mvista.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1281002322.1923.1708.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 806d1b227a21..ab661ebc4895 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -3752,6 +3752,8 @@ static void task_fork_fair(struct task_struct *p) | |||
3752 | 3752 | ||
3753 | raw_spin_lock_irqsave(&rq->lock, flags); | 3753 | raw_spin_lock_irqsave(&rq->lock, flags); |
3754 | 3754 | ||
3755 | update_rq_clock(rq); | ||
3756 | |||
3755 | if (unlikely(task_cpu(p) != this_cpu)) | 3757 | if (unlikely(task_cpu(p) != this_cpu)) |
3756 | __set_task_cpu(p, this_cpu); | 3758 | __set_task_cpu(p, this_cpu); |
3757 | 3759 | ||