From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>,
Fernando Fernandez Mancera <fmancera@suse.de>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next 0/3] netfilter: nft_set_rbtree: use cloned tree for insertions and removal
Date: Wed, 19 Nov 2025 16:56:34 +0100 [thread overview]
Message-ID: <aR3osq6hSxh7JwVm@strlen.de> (raw)
In-Reply-To: <aR29ddgmrjWcayAV@orbyte.nwl.cc>
Phil Sutter <phil@nwl.cc> wrote:
> > 200K elements ~ avg. time insertion before 510ms after 744ms
> > 500K elements ~ avg. time insertion before 5460ms after 7730ms
>
> I wonder if nft_rbtree_maybe_clone() could run a simpler copying
> algorithm than properly inserting every element from the old tree into
> the new one since the old tree is already correctly organized -
> basically leveraging the existing knowledge of every element's correct
> position.
Yes, but I doubt its going to help much.
And I don't see how this can be done without relying on implementation
details of rb_node struct.
> Or is there a need to traverse the new tree with each element instead of
> copying the whole thing as-is?
What do you mean?
next prev parent reply other threads:[~2025-11-19 15:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 11:16 [PATCH nf-next 0/3] netfilter: nft_set_rbtree: use cloned tree for insertions and removal Florian Westphal
2025-11-18 11:16 ` [PATCH nf-next 1/3] netfilter: nft_set_rbtree: prepare for two rbtrees Florian Westphal
2025-11-18 11:16 ` [PATCH nf-next 2/3] netfilter: nft_set_rbtree: factor out insert helper Florian Westphal
2025-11-18 11:16 ` [PATCH nf-next 3/3] netfilter: nft_set_rbtree: do not modifiy live tree Florian Westphal
2025-11-19 8:29 ` kernel test robot
2025-11-19 10:48 ` Florian Westphal
2025-11-18 16:07 ` [PATCH nf-next 0/3] netfilter: nft_set_rbtree: use cloned tree for insertions and removal Fernando Fernandez Mancera
2025-11-18 16:46 ` Florian Westphal
2025-11-18 17:01 ` Fernando Fernandez Mancera
2025-11-19 12:52 ` Phil Sutter
2025-11-19 15:56 ` Florian Westphal [this message]
2025-11-19 22:14 ` Phil Sutter
2025-11-20 10:28 ` Florian Westphal
2025-11-20 11:39 ` Fernando Fernandez Mancera
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=aR3osq6hSxh7JwVm@strlen.de \
--to=fw@strlen.de \
--cc=fmancera@suse.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.