diff options
author | Florian Westphal <fw@strlen.de> | 2016-08-25 13:33:31 (GMT) |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-30 09:43:09 (GMT) |
commit | f330a7fdbe1611104622faff7e614a246a7d20f0 (patch) | |
tree | 4e8395a54d455f94c9273d775cdb98f89f451ece /net/6lowpan/6lowpan_i.h | |
parent | 616b14b46957b52dc7e1f3ec2210d3f9051b1178 (diff) | |
download | linux-f330a7fdbe1611104622faff7e614a246a7d20f0.tar.xz |
netfilter: conntrack: get rid of conntrack timer
With stats enabled this eats 80 bytes on x86_64 per nf_conn entry, as
Eric Dumazet pointed out during netfilter workshop 2016.
Eric also says: "Another reason was the fact that Thomas was about to
change max timer range [..]" (500462a9de657f8, 'timers: Switch to
a non-cascading wheel').
Remove the timer and use a 32bit jiffies value containing timestamp until
entry is valid.
During conntrack lookup, even before doing tuple comparision, check
the timeout value and evict the entry in case it is too old.
The dying bit is used as a synchronization point to avoid races where
multiple cpus try to evict the same entry.
Because lookup is always lockless, we need to bump the refcnt once
when we evict, else we could try to evict already-dead entry that
is being recycled.
This is the standard/expected way when conntrack entries are destroyed.
Followup patches will introduce garbage colliction via work queue
and further places where we can reap obsoleted entries (e.g. during
netlink dumps), this is needed to avoid expired conntracks from hanging
around for too long when lookup rate is low after a busy period.
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/6lowpan/6lowpan_i.h')
0 files changed, 0 insertions, 0 deletions