Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: 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>

authored by

Oleg Nesterov and committed by
Linus Torvalds
d7c3f5f2 a98b6094

+1 -1
+1 -1
kernel/taskstats.c
··· 235 235 236 236 tsk = first; 237 237 do { 238 - if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk)) 238 + if (tsk->exit_state) 239 239 continue; 240 240 /* 241 241 * Accounting subsystem can call its functions here to