All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 2/2] debug: include kernel set information on cache fill
Date: Fri, 22 Nov 2024 14:43:27 +0100	[thread overview]
Message-ID: <20241122134327.GA17061@breakpoint.cc> (raw)
In-Reply-To: <Z0CInEpuxYA1bxFq@calendula>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > Sure, wasn't that the reason why you iniitially wanted to restrict this to
> > --netlink=debug?  What made you change your mind?
> 
> With large garbage collection cycle, this counter provides a hint to
> the user to understand that slots are still being consumed by expired
> elements.

But how / where is that relevant?

rbtree does gc at insert time.  We could extend rbtree to force gc
even if interval is huge in case we have many expired elements.

We could do this by making __nft_rbtree_insert() count the number
of expired nodes that it saw during traversal, then force gc at commit
time even if time_after_eq() isn't met.

> > Maybe apply the simpler, existing v1 patches only, i.e. no exposure?
> 
> My concern is that this is exposing this implementation detail of the
> rbtree, forever. Can we agree to do heuristics to hide this detail:
> 
> Assuming initial 0.0.0.0 dummy element is in place (this can be
> subtracted), then, division by two gives us the number of ranges.

Ouch.  This either means more kernel complexity and lie to userspace,
or leak rbtree details into nft, basically strcmp on the new
SET_TYPE nlattr string and then display something else on frontend side.

I'd prefer to avoid this mess.

  reply	other threads:[~2024-11-22 13:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 10:02 [PATCH nft 1/2] tests/py: prepare for set debug change Florian Westphal
2024-11-20 10:02 ` [PATCH nft 2/2] debug: include kernel set information on cache fill Florian Westphal
2024-11-20 23:29   ` Pablo Neira Ayuso
2024-11-20 23:38     ` Florian Westphal
2024-11-21  9:24       ` Florian Westphal
2024-11-21 10:00         ` Pablo Neira Ayuso
2024-11-21 12:02           ` Florian Westphal
2024-11-21 15:12             ` Pablo Neira Ayuso
2024-11-21 17:19               ` Florian Westphal
2024-11-22 13:35                 ` Pablo Neira Ayuso
2024-11-22 13:43                   ` Florian Westphal [this message]
2024-11-22 14:01                     ` Pablo Neira Ayuso
2024-11-22 14:38                       ` Florian Westphal

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=20241122134327.GA17061@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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.