Now that we're pointing cpuacct's root cgroup to cpustat and accounting
through task_group_account_field(), we should not access cpustat directly.
Since it is done anyway inside the acessor function, we end up accounting
it twice, which is wrong.
Signed-off-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1322863119-14225-2-git-send-email-glommer@parallels.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
void account_user_time(struct task_struct *p, cputime_t cputime,
cputime_t cputime_scaled)
{
void account_user_time(struct task_struct *p, cputime_t cputime,
cputime_t cputime_scaled)
{
- u64 *cpustat = kcpustat_this_cpu->cpustat;
- u64 tmp;
int index;
/* Add user time to process. */
int index;
/* Add user time to process. */
p->utimescaled = cputime_add(p->utimescaled, cputime_scaled);
account_group_user_time(p, cputime);
p->utimescaled = cputime_add(p->utimescaled, cputime_scaled);
account_group_user_time(p, cputime);
- /* Add user time to cpustat. */
- tmp = cputime_to_cputime64(cputime);
-
index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
+ /* Add user time to cpustat. */
task_group_account_field(p, index, cputime);
task_group_account_field(p, index, cputime);
/* Account for user time used */
acct_update_integrals(p);
}
/* Account for user time used */
acct_update_integrals(p);
}
void __account_system_time(struct task_struct *p, cputime_t cputime,
cputime_t cputime_scaled, int index)
{
void __account_system_time(struct task_struct *p, cputime_t cputime,
cputime_t cputime_scaled, int index)
{
- u64 tmp = cputime_to_cputime64(cputime);
- u64 *cpustat = kcpustat_this_cpu->cpustat;
-
/* Add system time to process. */
p->stime = cputime_add(p->stime, cputime);
p->stimescaled = cputime_add(p->stimescaled, cputime_scaled);
account_group_system_time(p, cputime);
/* Add system time to cpustat. */
/* Add system time to process. */
p->stime = cputime_add(p->stime, cputime);
p->stimescaled = cputime_add(p->stimescaled, cputime_scaled);
account_group_system_time(p, cputime);
/* Add system time to cpustat. */
task_group_account_field(p, index, cputime);
/* Account for system time used */
task_group_account_field(p, index, cputime);
/* Account for system time used */