]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[S390] fix idle time accounting
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 14 Apr 2009 13:36:26 +0000 (15:36 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 14 Apr 2009 13:37:26 +0000 (15:37 +0200)
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 <schwidefsky@de.ibm.com>
arch/s390/kernel/vtime.c

index 694b44374a2b0fd1c858d000a3a154f7583e2ede..c0870a61f90ff1a9042c1ed7ea54e44df676846b 100644 (file)
@@ -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. */