diff options
Diffstat (limited to 'kernel/delayacct.c')
-rw-r--r-- | kernel/delayacct.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/delayacct.c b/kernel/delayacct.c index 418b3f7053aa..d473988c1d0b 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c | |||
@@ -106,6 +106,7 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) | |||
106 | unsigned long long t2, t3; | 106 | unsigned long long t2, t3; |
107 | unsigned long flags; | 107 | unsigned long flags; |
108 | struct timespec ts; | 108 | struct timespec ts; |
109 | cputime_t utime, stime, stimescaled, utimescaled; | ||
109 | 110 | ||
110 | /* Though tsk->delays accessed later, early exit avoids | 111 | /* Though tsk->delays accessed later, early exit avoids |
111 | * unnecessary returning of other data | 112 | * unnecessary returning of other data |
@@ -114,12 +115,14 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) | |||
114 | goto done; | 115 | goto done; |
115 | 116 | ||
116 | tmp = (s64)d->cpu_run_real_total; | 117 | tmp = (s64)d->cpu_run_real_total; |
117 | cputime_to_timespec(tsk->utime + tsk->stime, &ts); | 118 | task_cputime(tsk, &utime, &stime); |
119 | cputime_to_timespec(utime + stime, &ts); | ||
118 | tmp += timespec_to_ns(&ts); | 120 | tmp += timespec_to_ns(&ts); |
119 | d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp; | 121 | d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp; |
120 | 122 | ||
121 | tmp = (s64)d->cpu_scaled_run_real_total; | 123 | tmp = (s64)d->cpu_scaled_run_real_total; |
122 | cputime_to_timespec(tsk->utimescaled + tsk->stimescaled, &ts); | 124 | task_cputime_scaled(tsk, &utimescaled, &stimescaled); |
125 | cputime_to_timespec(utimescaled + stimescaled, &ts); | ||
123 | tmp += timespec_to_ns(&ts); | 126 | tmp += timespec_to_ns(&ts); |
124 | d->cpu_scaled_run_real_total = | 127 | d->cpu_scaled_run_real_total = |
125 | (tmp < (s64)d->cpu_scaled_run_real_total) ? 0 : tmp; | 128 | (tmp < (s64)d->cpu_scaled_run_real_total) ? 0 : tmp; |