From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Vikash SS <thisisforspotifyvikash@gmail.com>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de,
linux-doc@vger.kernel.org, corbet@lwn.net
Subject: Re: [PATCH] netfilter: conntrack: document sparse hash table eviction
Date: Fri, 6 Nov 2026 15:06:22 +0100 [thread overview]
Message-ID: <au3e3qI5oXk8YI0K@chamomile> (raw)
In-Reply-To: <20261106135816.391285-1-thisisforspotifyvikash@gmail.com>
On Fri, Nov 06, 2026 at 01:58:16PM +0000, Vikash SS wrote:
> When nf_conntrack_max is significantly smaller than
> nf_conntrack_buckets, the hash table can become sparsely populated.
>
> The early_drop() path examines at most 8 consecutive hash buckets
> when searching for eviction candidates. Under table exhaustion,
> this bounded search may fail to find an eligible entry even when
> evictable connections exist elsewhere in the table.
>
> Document this limitation to clarify the implications of configuring
> nf_conntrack_max significantly below nf_conntrack_buckets.
>
> Signed-off-by: Vikash SS <thisisforspotifyvikash@gmail.com>
> ---
> Documentation/networking/nf_conntrack-sysctl.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/networking/nf_conntrack-sysctl.rst b/Documentation/networking/nf_conntrack-sysctl.rst
> index 4426cce2a..fc07a950b 100644
> --- a/Documentation/networking/nf_conntrack-sysctl.rst
> +++ b/Documentation/networking/nf_conntrack-sysctl.rst
> @@ -99,6 +99,10 @@ nf_conntrack_max - INTEGER
> the reversed address). This means that with default settings a maxed-out
> table will have a average hash chain length of 2, not 1.
>
> + Setting nf_conntrack_max much lower than nf_conntrack_buckets
> + may cause early eviction to fail under table exhaustion, as
> + the eviction search may not find entries in sparse hash tables.
Maybe provide a positive hint:
+ Make sure nf_conntrack_max is equal to or larger than
+ nf_conntrack_buckets, otherwise early drop may fail to evict
+ entries when it gets full.
> nf_conntrack_tcp_be_liberal - BOOLEAN
> - 0 - disabled (default)
> - not 0 - enabled
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-11-06 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 13:58 [PATCH] netfilter: conntrack: document sparse hash table eviction Vikash SS
2026-11-06 14:06 ` Pablo Neira Ayuso [this message]
2026-11-06 14:30 ` [PATCH v2] " Vikash SS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=au3e3qI5oXk8YI0K@chamomile \
--to=pablo@netfilter.org \
--cc=corbet@lwn.net \
--cc=fw@strlen.de \
--cc=linux-doc@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=thisisforspotifyvikash@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox