Skip to contentSkip to conversation

fill_tgid: cleanup delays accounting

PATCH Oleg Nesterov 1 participant 1 message Oct 27, 2006 Taskstats statistics interface

lore
Share & tools
lore
#0 lore raw

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.

kernel/taskstats.c renamed from kernel/taskstats.c~7_estate +1 -1
@@ -235,7 +235,7 @@ static int fill_tgid(pid_t tgid, struct 
 
 	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