]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: revisit the gc initial rescheduling bias
authorAntoine Tenart <atenart@kernel.org>
Fri, 16 Sep 2022 09:29:41 +0000 (11:29 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 21 Sep 2022 08:44:56 +0000 (10:44 +0200)
commit3e161ef3f3313fe9d77912849a330c626d7b0af2
treeb1b9163a33840039873dd5acf87a473542da6d2f
parente6b5d8c1704ba8e544ed7c60d1e835b2b7308e5d
netfilter: conntrack: revisit the gc initial rescheduling bias

The previous commit changed the way the rescheduling delay is computed
which has a side effect: the bias is now represented as much as the
other entries in the rescheduling delay which makes the logic to kick in
only with very large sets, as the initial interval is very large
(INT_MAX).

Revisit the GC initial bias to allow more frequent GC for smaller sets
while still avoiding wakeups when a machine is mostly idle. We're moving
from a large initial value to pretending we have 100 entries expiring at
the upper bound. This way only a few entries having a small timeout
won't impact much the rescheduling delay and non-idle machines will have
enough entries to lower the delay when needed. This also improves
readability as the initial bias is now linked to what is computed
instead of being an arbitrary large value.

Fixes: 5c8e48b81da4 ("netfilter: conntrack: revisit gc autotuning")
Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_conntrack_core.c