Commit 26e75b5c authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

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: default avatarOleg 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 986094df
...@@ -118,13 +118,10 @@ static void __exit_signal(struct task_struct *tsk) ...@@ -118,13 +118,10 @@ static void __exit_signal(struct task_struct *tsk)
} }
/* /*
* Accumulate here the counters for all threads but the group leader * Accumulate here the counters for all threads as they die. We could
* as they die, so they can be added into the process-wide totals * skip the group leader because it is the last user of signal_struct,
* when those are taken. The group leader stays around as a zombie as * but we want to avoid the race with thread_group_cputime() which can
* long as there are other threads. When it gets reaped, the exit.c * see the empty ->thread_head list.
* 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.
*/ */
task_cputime(tsk, &utime, &stime); task_cputime(tsk, &utime, &stime);
write_seqlock(&sig->stats_lock); write_seqlock(&sig->stats_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment