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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/15, Guillaume Chazarain wrote:
>
> Le Thu, 13 Sep 2007 16:41:41 +0400,
> Oleg Nesterov <[email protected]> a ??crit :
> 
> > > +	do
> > > +		if (!tsk->exit_state)
> > > +			add_tsk(stats, tsk);
> > > +	while_each_thread(first, tsk);
> > 
> > This reminds me. The "!tsk->exit_state" is not good and racy, it
> > can't prevent the double accounting (of course, I don't blame this
> > patch).
> 
> 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.

No, this is not enough. There is a window between do_exit()->taskstats_exit()
and do_exit()->exit_notify() which sets ->exit_state. Probably, we can
shift taskstats_exit() into exit_notify() but this is not good.

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux