aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/cputime.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index e1939d38bf73..c533deaf06d5 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -164,7 +164,7 @@ void account_user_time(struct task_struct *p, cputime_t cputime,
164 task_group_account_field(p, index, (__force u64) cputime); 164 task_group_account_field(p, index, (__force u64) cputime);
165 165
166 /* Account for user time used */ 166 /* Account for user time used */
167 acct_update_integrals(p); 167 acct_account_cputime(p);
168} 168}
169 169
170/* 170/*
@@ -214,7 +214,7 @@ void __account_system_time(struct task_struct *p, cputime_t cputime,
214 task_group_account_field(p, index, (__force u64) cputime); 214 task_group_account_field(p, index, (__force u64) cputime);
215 215
216 /* Account for system time used */ 216 /* Account for system time used */
217 acct_update_integrals(p); 217 acct_account_cputime(p);
218} 218}
219 219
220/* 220/*
@@ -296,6 +296,7 @@ static __always_inline bool steal_account_process_tick(void)
296void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) 296void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
297{ 297{
298 struct signal_struct *sig = tsk->signal; 298 struct signal_struct *sig = tsk->signal;
299 cputime_t utime, stime;
299 struct task_struct *t; 300 struct task_struct *t;
300 301
301 times->utime = sig->utime; 302 times->utime = sig->utime;
@@ -309,8 +310,9 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
309 310
310 t = tsk; 311 t = tsk;
311 do { 312 do {
312 times->utime += t->utime; 313 task_cputime(tsk, &utime, &stime);
313 times->stime += t->stime; 314 times->utime += utime;
315 times->stime += stime;
314 times->sum_exec_runtime += task_sched_runtime(t); 316 times->sum_exec_runtime += task_sched_runtime(t);
315 } while_each_thread(tsk, t); 317 } while_each_thread(tsk, t);
316out: 318out:
@@ -588,11 +590,10 @@ static void cputime_adjust(struct task_cputime *curr,
588void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st) 590void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st)
589{ 591{
590 struct task_cputime cputime = { 592 struct task_cputime cputime = {
591 .utime = p->utime,
592 .stime = p->stime,
593 .sum_exec_runtime = p->se.sum_exec_runtime, 593 .sum_exec_runtime = p->se.sum_exec_runtime,
594 }; 594 };
595 595
596 task_cputime(p, &cputime.utime, &cputime.stime);
596 cputime_adjust(&cputime, &p->prev_cputime, ut, st); 597 cputime_adjust(&cputime, &p->prev_cputime, ut, st);
597} 598}
598 599