From: Mike Galbraith Date: Mon, 15 Oct 2007 15:00:07 +0000 (+0200) Subject: sched: fix SMP migration latencies X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=119fe5e06800afc197781ebc8c2d8ca7d03497c8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 0f0cf374c775..4ad789d268fe 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); }