Skip to content

Commit

Permalink
sched/cputime: Fix accounting on multi-threaded processes
Browse files Browse the repository at this point in the history
Recent commit 6fac482 ("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>
  • Loading branch information
Stanislaw Gruszka authored and Ingo Molnar committed Apr 8, 2013
1 parent fd9b86d commit e614b33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/cputime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e614b33

Please sign in to comment.