path: root/kernel/exit.c
diff options
authorOleg Nesterov <>2014-12-10 15:54:54 -0800
committerLinus Torvalds <>2014-12-10 17:41:17 -0800
commit26e75b5c3d2226cb995fde064744aa93f63849c4 (patch)
tree3cdeaa25eba2f3c7aa5ecd897dd796116c8b5712 /kernel/exit.c
parent986094dfe161b4346831547136d4e5ed7f94310e (diff)
exit: release_task: fix the comment about group leader accounting
Contrary to what the comment in __exit_signal() says we do account the group leader. Fix this and explain why. Signed-off-by: Oleg Nesterov <> Cc: Aaron Tomlin <> Cc: "Eric W. Biederman" <> Cc: Rik van Riel <> Cc: Sterling Alexander <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel/exit.c')
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 6297eb0f5bd2..9a65f10dc9ff 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -118,13 +118,10 @@ static void __exit_signal(struct task_struct *tsk)
- * Accumulate here the counters for all threads but the group leader
- * as they die, so they can be added into the process-wide totals
- * when those are taken. The group leader stays around as a zombie as
- * long as there are other threads. When it gets reaped, the exit.c
- * code will add its counts into these totals. We won't ever get here
- * for the group leader, since it will have been the last reference on
- * the signal_struct.
+ * Accumulate here the counters for all threads as they die. We could
+ * skip the group leader because it is the last user of signal_struct,
+ * but we want to avoid the race with thread_group_cputime() which can
+ * see the empty ->thread_head list.
task_cputime(tsk, &utime, &stime);