Commit d7c3f5f2 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[PATCH] fill_tgid: cleanup delays accounting

fill_tgid() should skip not only an already exited group leader.  If the
task has ->exit_state != 0 it already did exit_notify(), so it also did
fill_tgid_exit()->delayacct_add_tsk(->signal->stats) and we should skip it
to avoid a double accounting.

This patch doesn't close the race completely, but it cleanups the code.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Jay Lan <jlan@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a98b6094
...@@ -235,7 +235,7 @@ static int fill_tgid(pid_t tgid, struct task_struct *first, ...@@ -235,7 +235,7 @@ static int fill_tgid(pid_t tgid, struct task_struct *first,
tsk = first; tsk = first;
do { do {
if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk)) if (tsk->exit_state)
continue; continue;
/* /*
* Accounting subsystem can call its functions here to * Accounting subsystem can call its functions here to
......
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