aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/vtime.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 09:11:37 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 09:11:46 -0500
commit457533a7d3402d1d91fbc125c8bd1bd16dcd3cd4 (patch)
treecbe69310a66176dea2a9e7bd201db95efe4a2890 /arch/s390/kernel/vtime.c
parent6a94cb73064c952255336cc57731904174b2c58f (diff)
[PATCH] fix scaled & unscaled cputime accounting
The utimescaled / stimescaled fields in the task structure and the global cpustat should be set on all architectures. On s390 the calls to account_user_time_scaled and account_system_time_scaled never have been added. In addition system time that is accounted as guest time to the user time of a process is accounted to the scaled system time instead of the scaled user time. To fix the bugs and to prevent future forgetfulness this patch merges account_system_time_scaled into account_system_time and account_user_time_scaled into account_user_time. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Michael Neuling <mikey@neuling.org> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/vtime.c')
-rw-r--r--arch/s390/kernel/vtime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 75a6e62ea973..07283aea2e56 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -50,12 +50,12 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
50 rcu_user_flag = cputime != 0; 50 rcu_user_flag = cputime != 0;
51 S390_lowcore.user_timer -= cputime << 12; 51 S390_lowcore.user_timer -= cputime << 12;
52 S390_lowcore.steal_clock -= cputime << 12; 52 S390_lowcore.steal_clock -= cputime << 12;
53 account_user_time(tsk, cputime); 53 account_user_time(tsk, cputime, cputime);
54 54
55 cputime = S390_lowcore.system_timer >> 12; 55 cputime = S390_lowcore.system_timer >> 12;
56 S390_lowcore.system_timer -= cputime << 12; 56 S390_lowcore.system_timer -= cputime << 12;
57 S390_lowcore.steal_clock -= cputime << 12; 57 S390_lowcore.steal_clock -= cputime << 12;
58 account_system_time(tsk, HARDIRQ_OFFSET, cputime); 58 account_system_time(tsk, HARDIRQ_OFFSET, cputime, cputime);
59 59
60 cputime = S390_lowcore.steal_clock; 60 cputime = S390_lowcore.steal_clock;
61 if ((__s64) cputime > 0) { 61 if ((__s64) cputime > 0) {
@@ -82,12 +82,12 @@ void account_vtime(struct task_struct *tsk)
82 cputime = S390_lowcore.user_timer >> 12; 82 cputime = S390_lowcore.user_timer >> 12;
83 S390_lowcore.user_timer -= cputime << 12; 83 S390_lowcore.user_timer -= cputime << 12;
84 S390_lowcore.steal_clock -= cputime << 12; 84 S390_lowcore.steal_clock -= cputime << 12;
85 account_user_time(tsk, cputime); 85 account_user_time(tsk, cputime, cputime);
86 86
87 cputime = S390_lowcore.system_timer >> 12; 87 cputime = S390_lowcore.system_timer >> 12;
88 S390_lowcore.system_timer -= cputime << 12; 88 S390_lowcore.system_timer -= cputime << 12;
89 S390_lowcore.steal_clock -= cputime << 12; 89 S390_lowcore.steal_clock -= cputime << 12;
90 account_system_time(tsk, 0, cputime); 90 account_system_time(tsk, 0, cputime, cputime);
91} 91}
92 92
93/* 93/*
@@ -107,7 +107,7 @@ void account_system_vtime(struct task_struct *tsk)
107 cputime = S390_lowcore.system_timer >> 12; 107 cputime = S390_lowcore.system_timer >> 12;
108 S390_lowcore.system_timer -= cputime << 12; 108 S390_lowcore.system_timer -= cputime << 12;
109 S390_lowcore.steal_clock -= cputime << 12; 109 S390_lowcore.steal_clock -= cputime << 12;
110 account_system_time(tsk, 0, cputime); 110 account_system_time(tsk, 0, cputime, cputime);
111} 111}
112EXPORT_SYMBOL_GPL(account_system_vtime); 112EXPORT_SYMBOL_GPL(account_system_vtime);
113 113