aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/timer.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 /kernel/timer.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 'kernel/timer.c')
-rw-r--r--kernel/timer.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index 566257d1dc10..b5efb528aa1d 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1023,13 +1023,11 @@ void account_process_tick(struct task_struct *p, int user_tick)
1023{ 1023{
1024 cputime_t one_jiffy = jiffies_to_cputime(1); 1024 cputime_t one_jiffy = jiffies_to_cputime(1);
1025 1025
1026 if (user_tick) { 1026 if (user_tick)
1027 account_user_time(p, one_jiffy); 1027 account_user_time(p, one_jiffy, cputime_to_scaled(one_jiffy));
1028 account_user_time_scaled(p, cputime_to_scaled(one_jiffy)); 1028 else
1029 } else { 1029 account_system_time(p, HARDIRQ_OFFSET, one_jiffy,
1030 account_system_time(p, HARDIRQ_OFFSET, one_jiffy); 1030 cputime_to_scaled(one_jiffy));
1031 account_system_time_scaled(p, cputime_to_scaled(one_jiffy));
1032 }
1033} 1031}
1034#endif 1032#endif
1035 1033