From: Frederic Weisbecker Date: Thu, 5 Jan 2017 17:11:42 +0000 (+0100) Subject: sched/cputime, ia64: Fix incorrect start cputime assignment on task switch X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8388d21468e7e7656867b67ab2ec98a78c9ad799;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sched/cputime, ia64: Fix incorrect start cputime assignment on task switch On task switch we must initialize the current cputime of the next task using the value of the previous task which got freshly updated. But we are confusing that with doing the opposite, which should result in incorrect cputime accounting. Signed-off-by: Frederic Weisbecker Acked-by: Thomas Gleixner Cc: Benjamin Herrenschmidt Cc: Christian Borntraeger Cc: Fenghua Yu Cc: Heiko Carstens Cc: Linus Torvalds Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rik van Riel Cc: Stanislaw Gruszka Cc: Tony Luck Cc: Wanpeng Li Link: http://lkml.kernel.org/r/1483636310-6557-3-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 71775b95d6cc..637e7413632c 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -83,7 +83,7 @@ void arch_vtime_task_switch(struct task_struct *prev) struct thread_info *pi = task_thread_info(prev); struct thread_info *ni = task_thread_info(current); - pi->ac_stamp = ni->ac_stamp; + ni->ac_stamp = pi->ac_stamp; ni->ac_stime = ni->ac_utime = 0; }