diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2013-04-04 04:57:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-08 11:40:52 -0400 |
commit | e614b3332a4f3f264a26da28e5a1f4cc3aea3974 (patch) | |
tree | fcc2e93829d8fc93867c64f58a637cf4fadf5c5e /kernel | |
parent | fd9b86d37a600488dbd80fe60cca46b822bff1cd (diff) |
sched/cputime: Fix accounting on multi-threaded processes
Recent commit 6fac4829 ("cputime: Use accessors to read task
cputime stats") introduced a bug, where we account many times
the cputime of the first thread, instead of cputimes of all
the different threads.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130404085740.GA2495@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/cputime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index ed12cbb135f4..e93cca92f38b 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c | |||
@@ -310,7 +310,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) | |||
310 | 310 | ||
311 | t = tsk; | 311 | t = tsk; |
312 | do { | 312 | do { |
313 | task_cputime(tsk, &utime, &stime); | 313 | task_cputime(t, &utime, &stime); |
314 | times->utime += utime; | 314 | times->utime += utime; |
315 | times->stime += stime; | 315 | times->stime += stime; |
316 | times->sum_exec_runtime += task_sched_runtime(t); | 316 | times->sum_exec_runtime += task_sched_runtime(t); |