Skip to contentSkip to conversation

cputime: Fix accounting on multi-threaded processes

PATCH New Stanislaw Gruszka 2 participants 2 messages Apr 4, 2013 – Apr 10, 2013 Scheduler

lore
Share & tools
lore
#0 lore raw

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.

---
This patch fixes 3.8 -> 3.9 regression, please apply.

 kernel/sched/cputime.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched/cputime.c +1 -1
index ed12cbb..e93cca9 100644
@@ -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
#1 lore raw

[tip:sched/urgent] sched/cputime: Fix accounting on multi-threaded processes

sched/cputime: Fix accounting on multi-threaded processes
Commit-ID:  e614b3332a4f3f264a26da28e5a1f4cc3aea3974
Gitweb:     http://git.kernel.org/tip/e614b3332a4f3f264a26da28e5a1f4cc3aea3974
Author:     Stanislaw Gruszka <[email protected]>
AuthorDate: Thu, 4 Apr 2013 10:57:48 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 8 Apr 2013 17:40:52 +0200

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.

---
 kernel/sched/cputime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/cputime.c +1 -1
index ed12cbb..e93cca9 100644
@@ -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);