netfilter: nf_conntrack: Reduce conntrack count in nf_conntrack_free()
We use RCU to defer freeing of conntrack structures. In DOS situation, RCU might accumulate about 10.000 elements per CPU in its internal queues. To get accurate conntrack counts (at the expense of slightly more RAM used), we might consider conntrack counter not taking into account "about to be freed elements, waiting in RCU queues". We thus decrement it in nf_conntrack_free(), not in the RCU callback. Signed-off-by: NEric Dumazet <dada1@cosmosbay.com> Tested-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: NPatrick McHardy <kaber@trash.net>
Showing
想要评论请 注册 或 登录