From: Stanislaw Gruszka Date: Thu, 4 Apr 2013 08:57:48 +0000 (+0200) Subject: sched/cputime: Fix accounting on multi-threaded processes X-Git-Tag: upstream/snapshot3+hdmi~5347^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e614b3332a4f3f264a26da28e5a1f4cc3aea3974;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Acked-by: Frederic Weisbecker Cc: Oleg Nesterov Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20130404085740.GA2495@redhat.com Signed-off-by: Ingo Molnar --- 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);