summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2007-10-15 17:00:07 +0200
committerIngo Molnar <mingo@elte.hu>2007-10-15 17:00:07 +0200
commit119fe5e06800afc197781ebc8c2d8ca7d03497c8 (patch)
tree9e2c57360f6d7442b6e6e1e2c15542805f322231 /kernel/sched.c
parent02e0431a3db554019b816936b597d618256b705d (diff)
sched: fix SMP migration latencies
fix SMP migration latencies: the vruntimes of different CPUs are at incompatible offsets so they have to be fixed up when migrating a task across CPUs. Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0f0cf374c77..4ad789d268f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -992,6 +992,9 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
if (p->se.block_start)
p->se.block_start -= clock_offset;
#endif
+ if (likely(new_rq->cfs.min_vruntime))
+ p->se.vruntime -= old_rq->cfs.min_vruntime -
+ new_rq->cfs.min_vruntime;
__set_task_cpu(p, new_cpu);
}