Skip to content

Commit

Permalink
[PATCH] fill_tgid: cleanup delays accounting
Browse files Browse the repository at this point in the history
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: Oleg 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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 28, 2006
1 parent a98b609 commit d7c3f5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static int fill_tgid(pid_t tgid, struct task_struct *first,

tsk = first;
do {
if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk))
if (tsk->exit_state)
continue;
/*
* Accounting subsystem can call its functions here to
Expand Down

0 comments on commit d7c3f5f

Please sign in to comment.