On Fri, Nov 27, 2009 at 04:15:21PM +0100, Oleg Nesterov wrote: > On 11/27, Ananth N Mavinakayanahalli wrote: > > > > I am confused as to why we need two atomics count and live in signal_struct. > > > > report_death() uses ->live as the group_dead indicator, > > report_death? Perhaps you meant do_exit() ?
Right, do_exit() and that is what is picked up by tracehook_report_death(), and in turn by report_death(). > > while there are > > places (like the scheduler) which uses ->count as the nr_threads > > indicator. > > > > I tried git blame to see if it remembers why, but the addition predates > > 2.6.12 and so it does not know. > > > > Could you please shed some light on this? > > In short: signal->count must die. I was going to do this a long ago > but never had the time. See also 4ab6c08336535f8c8e42cf45d7adeda882eff06e > commit, this is the first step. > > Last time I did the grepping almost any usage of signal->count is > not right. For example, __exit_signal() is correct, but it doesn't > need to use ->count. > > Except: it is needed for things like get_nr_threads() in proc. > > In short: never use signal->count ;) Thanks for the clarification Oleg. Ananth