Re: + taskstats-add-all-thread-stats-for-taskstats_cmd_attr_tgid.patch added to -mm tree

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Oleg Nesterov <oleg@...>
Cc: <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>, <balbir@...>, <jlan@...>, <jlim@...>
Date: Saturday, September 15, 2007 - 2:51 pm

Le Thu, 13 Sep 2007 16:41:41 +0400,
Oleg Nesterov <oleg@tv-sign.ru> a écrit :


Thank you Oleg, hopefully I addressed all your comments in v4.


I documented this in v4, but I was wondering if always setting
tsk->exit_state under the protection of lock_task_sighand() would fix
the race.


Seems like this code was copied from kernel/acct.c:acct_collect():
	if (thread_group_leader(current)) {
		pacct->ac_exitcode = exitcode;
		if (current->flags & PF_FORKNOEXEC)
			pacct->ac_flag |= AFORK;
	}


From include/linux/acct.h: executed fork, but did not exec

Except that it talks about fork(2), not do_fork() hence the
thread_group_leader() test to avoid flagging threads.


I put ->signal->group_exit_code if not null, otherwise
leader->exit_code.

Thank again to you and Andrew for the review.

-- 
Guillaume
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: + taskstats-add-all-thread-stats-for-taskstats_cmd_attr_..., Guillaume Chazarain, (Sat Sep 15, 2:51 pm)