aboutsummaryrefslogtreecommitdiffstats
path: root/net/lapb/lapb_iface.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <[email protected]>2011-06-27 23:18:11 +0000
committerLinus Torvalds <[email protected]>2011-06-28 01:00:13 +0000
commit26c4caea9d697043cc5a458b96411b86d7f6babd (patch)
treecf4de2553fbfcafc41eb4f84bc9ee1eb69adf725 /net/lapb/lapb_iface.c
parentmm: fix assertion mapping->nrpages == 0 in end_writeback() (diff)
downloadkernel-26c4caea9d697043cc5a458b96411b86d7f6babd.tar.gz
kernel-26c4caea9d697043cc5a458b96411b86d7f6babd.zip
taskstats: don't allow duplicate entries in listener mode
Currently a single process may register exit handlers unlimited times. It may lead to a bloated listeners chain and very slow process terminations. Eg 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. Signed-off-by: Vasiliy Kulikov <[email protected]> Cc: Balbir Singh <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions