[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>
This commit is contained in:
@@ -1023,13 +1023,11 @@ void account_process_tick(struct task_struct *p, int user_tick)
|
||||
{
|
||||
cputime_t one_jiffy = jiffies_to_cputime(1);
|
||||
|
||||
if (user_tick) {
|
||||
account_user_time(p, one_jiffy);
|
||||
account_user_time_scaled(p, cputime_to_scaled(one_jiffy));
|
||||
} else {
|
||||
account_system_time(p, HARDIRQ_OFFSET, one_jiffy);
|
||||
account_system_time_scaled(p, cputime_to_scaled(one_jiffy));
|
||||
}
|
||||
if (user_tick)
|
||||
account_user_time(p, one_jiffy, cputime_to_scaled(one_jiffy));
|
||||
else
|
||||
account_system_time(p, HARDIRQ_OFFSET, one_jiffy,
|
||||
cputime_to_scaled(one_jiffy));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user