From: Mike Galbraith Date: Mon, 15 Oct 2007 15:00:07 +0000 (+0200) Subject: sched: fix SMP migration latencies X-Git-Tag: v2.6.24-rc1~1289^2~103 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=119fe5e06800afc197781ebc8c2d8ca7d03497c8;p=linux-2.6 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 Signed-off-by: Ingo Molnar Signed-off-by: Peter Zijlstra Reviewed-by: Thomas Gleixner --- diff --git a/kernel/sched.c b/kernel/sched.c index 0f0cf374c7..4ad789d268 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); }