aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-12-10 15:54:54 -0800
committerMoyster <oysterized@gmail.com>2019-05-02 18:26:15 +0200
commit624badb1d102f8f0585c32b4224ac21a02201ea1 (patch)
treeaef575ec07fedaa98d8fe109d391328a76ae9204
parent1b92683e31af28b4be2837a2299fc8076f5bb6d7 (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. Change-Id: Ib07c92c4debe3303eae43cabd1cd496ad5feda16 Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Aaron Tomlin <atomlin@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Rik van Riel <riel@redhat.com> Cc: Sterling Alexander <stalexan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/exit.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index e09376974..64f2e0623 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -123,13 +123,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);
sig->utime += utime;