On Tue, Jun 28, 2011 at 4:48 AM,  <[email protected]> wrote:
> From: Vasiliy Kulikov <[email protected]>
>
> Currently a single process may register exit handlers unlimited times.  It
> may lead to a bloated listeners chain and very slow process terminations.
> E.g.  after 10KK sent TASKSTATS_CMD_ATTR_REGISTER_CPUMASKs ~300 Mb of
> kernel memory is stolen for the handlers chain and "time id" shows 2-7
> seconds instead of normal 0.003.  It makes it possible to exhaust all
> kernel memory and to eat much of CPU time by triggerring numerous exits on
> a single CPU.
>
> The patch limits the number of times a single process may register itself
> on a single CPU to one.
>
> One little issue is kept unfixed - as taskstats_exit() is called before
> exit_files() in do_exit(), the orphaned listener entry (if it was not
> explicitly deregistered) is kept until the next someone's exit() and
> implicit deregistration in send_cpu_listeners().  So, if a process
> registered itself as a listener exits and the next spawned process gets
> the same pid, it would inherit taskstats attributes.
>

I think we can track listener exits if required, although at the cost
of a high overhead

Seems reasonable, I'll update the documentation to indicate that this
change might break some user space stuff that was able to do multiple
connections earlier.

Balbir Singh

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to