Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756970AbZDNN5h (ORCPT ); Tue, 14 Apr 2009 09:57:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756350AbZDNNyF (ORCPT ); Tue, 14 Apr 2009 09:54:05 -0400 Received: from mtagate8.de.ibm.com ([195.212.29.157]:59104 "EHLO mtagate8.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756228AbZDNNxv (ORCPT ); Tue, 14 Apr 2009 09:53:51 -0400 Message-Id: <20090414135349.139318931@de.ibm.com> References: <20090414135327.576111185@de.ibm.com> User-Agent: quilt/0.46-1 Date: Tue, 14 Apr 2009 15:53:38 +0200 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Heiko Carstens , Martin Schwidefsky Subject: [patch 11/14] fix idle time accounting Content-Disposition: inline; filename=011-idle-accounting.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1548 Lines: 42 From: Martin Schwidefsky The steal time is calculated by subtracting the time the virtual cpu has been running on a physical cpu from the wall clock time. To make that work all wall time needs to be added to the steal time field first before the virtual cpu time is subtracted. The time between the last clock update and the load of the enabled wait psw needs to be added to the steal_time field as well to make the sum over all cpu accounting numbers match the wall clock. Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/vtime.c | 2 ++ 1 file changed, 2 insertions(+) Index: quilt-2.6/arch/s390/kernel/vtime.c =================================================================== --- quilt-2.6.orig/arch/s390/kernel/vtime.c +++ quilt-2.6/arch/s390/kernel/vtime.c @@ -134,6 +134,8 @@ void vtime_start_cpu(void) /* Account time spent with enabled wait psw loaded as idle time. */ idle_time = S390_lowcore.int_clock - idle->idle_enter; account_idle_time(idle_time); + S390_lowcore.steal_timer += + idle->idle_enter - S390_lowcore.last_update_clock; S390_lowcore.last_update_clock = S390_lowcore.int_clock; /* Account system time spent going idle. */ -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/