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

From: Oleg Nesterov
Date: Thu Jul 21 2011 - 10:32:32 EST


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@xxxxxxxxxxxx>

Thanks,

Oleg.

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