From: Chris Arges <carges@cloudflare.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>,
stable@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
lwn@lwn.net, jslaby@suse.cz, kernel-team@cloudflare.com,
netfilter-devel@vger.kernel.org
Subject: Re: [REGRESSION] 6.18.14 netfilter/nftables consumes way more memory
Date: Fri, 6 Mar 2026 12:20:16 -0600 [thread overview]
Message-ID: <aasa4AV5p7TFxNmj@20HS2G4> (raw)
In-Reply-To: <aarHyHIQY0nS9d9K@chamomile>
On 2026-03-06 13:25:44, Pablo Neira Ayuso wrote:
<snip>
> > I see what is going on, my resize logic is not correct. This is
> > increasing the size for each new transaction, then the array is
> > getting larger and larger on each transaction update.
> >
> > Could you please give a try to this patch?
>
> Scratch that.
>
> Please, give a try to this patch.
>
> Thanks.
Pablo,
Thanks, I'm getting this set up on a few machines. I will have:
- 6.18.15 (original kernel version that repo'd the issue for us)
- 6.18.15 + this patch
- 6.18.15 + revert rbtree patchseries
I'll compare memory usage with those 3 variants and give a response.
--chris
> diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
> index 853ff30a208c..cffeb6f5c532 100644
> --- a/net/netfilter/nft_set_rbtree.c
> +++ b/net/netfilter/nft_set_rbtree.c
> @@ -646,7 +646,7 @@ static int nft_array_may_resize(const struct nft_set *set)
> struct nft_array *array;
>
> if (!priv->array_next) {
> - array = nft_array_alloc(nelems + NFT_ARRAY_EXTRA_SIZE);
> + array = nft_array_alloc(priv->array->max_intervals);
> if (!array)
> return -ENOMEM;
>
next prev parent reply other threads:[~2026-03-06 18:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 17:50 [REGRESSION] 6.18.14 netfilter/nftables consumes way more memory Chris Arges
2026-03-04 21:26 ` Pablo Neira Ayuso
2026-03-04 21:27 ` Pablo Neira Ayuso
2026-03-05 16:28 ` Chris Arges
2026-03-06 12:22 ` Pablo Neira Ayuso
2026-03-06 12:25 ` Pablo Neira Ayuso
2026-03-06 18:20 ` Chris Arges [this message]
2026-03-07 0:15 ` Pablo Neira Ayuso
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=aasa4AV5p7TFxNmj@20HS2G4 \
--to=carges@cloudflare.com \
--cc=fw@strlen.de \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lwn@lwn.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=stable@vger.kernel.org \
/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