Re: [PATCH 2/2] taskstats: add_del_listener() should ignore !valid listener's

Oleg Nesterov
2011-07-21T14:32:30Z

On 07/21, Vasiliy Kulikov wrote:
>
> On Wed, Jul 20, 2011 at 23:01 +0200, Oleg Nesterov wrote:
> >
> > Not sure I understand... This is not optimizing, the patch tries to
> > fix the unlikely (in fact mostly theoretical) and minor problem.
>
> Ah, I see the problem here. Yes, then it surely makes sense.

Yes, agreed.

Just in case... please note that "s->pid can be reused" doesn't
necessarily mean this pid was reused by kernel. For example, a
task can close the socket without DEREGISTER, then create another
one and do REGISTER which can race with send_cpu_listeners().
Afaics.

All this register/deregister logic doesn't look very right, imho.

> Reviewed-by: Vasiliy Kulikov <segoon@openwall.com>

Thanks,

Oleg.