summaryrefslogtreecommitdiffstats
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
parentfd9b86d37a600488dbd80fe60cca46b822bff1cd (diff)
downloadop-kernel-dev-e614b3332a4f3f264a26da28e5a1f4cc3aea3974.zip
op-kernel-dev-e614b3332a4f3f264a26da28e5a1f4cc3aea3974.tar.gz
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>
-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 ed12cbb..e93cca9 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);
OpenPOWER on IntegriCloud