From: Florian Westphal <fw@strlen.de>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next 0/3] netfilter: nft_set_rbtree: use cloned tree for insertions and removal
Date: Tue, 18 Nov 2025 17:46:29 +0100 [thread overview]
Message-ID: <aRyi5VVq6HKTvEDm@strlen.de> (raw)
In-Reply-To: <9a4e63da-6d36-4365-8c08-547961c9bfa7@suse.de>
Fernando Fernandez Mancera <fmancera@suse.de> wrote:
> When adding a new element, it is inserted into the cloned copy and we
> swap the genbit so root[1] is now live. Then, when we are sure that the
> operation was successful, we update root[0] with the same operation.
> Therefore, root[0] and root[1] are now identical.
I don't understand this. The swap can't be done before ->commit().
Else, how do you deal with a rollback (failing transaction)?
Not exposing any of the new elements to the data path until
the entire transaction has moved past the point-of-no-return
is large part of the patch series.
After commit, yes, we can do a walk of the old tree, purge
old elements, then walk the new tree, add new elements to the old
tree so they are identical again.
But that doesn't sound faster than duplicating everything
on next insert/removal.
> This way we can avoid the clone operation which is quite expensive.. of
> course, it would require to do the insert/removal operation twice.. but
> that is cheaper if I am not wrong.
How do I know what to re-insert and to remove from the old live tree
without a walk of the new tree?
> Maybe I am asking for too much (?). Also it brings some problems.. like
> what if the sync operation fails, should we re-do the cloning?
How can the sync op fail? Can you elaborate?
next prev parent reply other threads:[~2025-11-18 16:46 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 [this message]
2025-11-18 17:01 ` Fernando Fernandez Mancera
2025-11-19 12:52 ` Phil Sutter
2025-11-19 15:56 ` Florian Westphal
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=aRyi5VVq6HKTvEDm@strlen.de \
--to=fw@strlen.de \
--cc=fmancera@suse.de \
--cc=netfilter-devel@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 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.