From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971036AbdAERNm (ORCPT ); Thu, 5 Jan 2017 12:13:42 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36253 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759720AbdAERL7 (ORCPT ); Thu, 5 Jan 2017 12:11:59 -0500 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Martin Schwidefsky , Tony Luck , Fenghua Yu , Peter Zijlstra , Rik van Riel , Thomas Gleixner , Ingo Molnar , Stanislaw Gruszka , Wanpeng Li , Christian Borntraeger Subject: [PATCH 02/10] ia64: Fix wrong start cputime assignment on task switch Date: Thu, 5 Jan 2017 18:11:42 +0100 Message-Id: <1483636310-6557-3-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483636310-6557-1-git-send-email-fweisbec@gmail.com> References: <1483636310-6557-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrong cputime accounting. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: Tony Luck Cc: Fenghua Yu Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Stanislaw Gruszka Cc: Wanpeng Li Cc: Christian Borntraeger Signed-off-by: Frederic Weisbecker --- arch/ia64/kernel/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 71775b95..637e741 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; } -- 2.7.4