summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2013-04-04 10:57:48 +0200
committerIngo Molnar <mingo@kernel.org>2013-04-08 17:40:52 +0200
commite614b3332a4f3f264a26da28e5a1f4cc3aea3974 (patch)
treefcc2e93829d8fc93867c64f58a637cf4fadf5c5e /kernel
parentsched/debug: Fix sd->*_idx limit range avoiding overflow (diff)
downloadlinux-e614b3332a4f3f264a26da28e5a1f4cc3aea3974.tar.xz
linux-e614b3332a4f3f264a26da28e5a1f4cc3aea3974.zip
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.c2
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)
t = tsk;
do {
- task_cputime(tsk, &utime, &stime);
+ task_cputime(t, &utime, &stime);
times->utime += utime;
times->stime += stime;
times->sum_exec_runtime += task_sched_runtime(t);