cputime: Fix accounting on multi-threaded processes
PATCH 1/1 cputime: Fix accounting on multi-threaded processes
Recent commit 6fac4829 "cputime: Use accessors to read task cputime stats" introduced a bug, that make we account many times cputime of the first thread, instead of cputimes of all threads.
Signed-off-by Stanislaw Gruszka <[email protected]>
--- kernel/sched/cputime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched/cputime.c +1 -1
@@ -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);
Signature · 1 line
1.7.1
2013/3/28 Stanislaw Gruszka <[email protected]>:
Quoted 5 lines
Recent commit
6fac4829"cputime: Use accessors to read task cputime stats" introduced a bug, that make we account many times cputime of the first thread, instead of cputimes of all threads.Signed-off-by Stanislaw Gruszka <[email protected]>
Nice catch!