netfilter-devel.vger.kernel.org archive mirror
 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 nf-next] netfilter: nf_conntrack: speed up reads from nf_conntrack proc file
Date: Wed, 12 Mar 2025 19:28:38 +0100	[thread overview]
Message-ID: <20250312182838.GB3007@breakpoint.cc> (raw)
In-Reply-To: <Z9G8TcHOTdn7LBsj@calendula>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > -	struct ct_iter_state *st = seq->private;
> > +		hlist_nulls_for_each_entry(h, n, &st->hash[i], hnnode) {
> 
>                 hlist_nulls_for_each_entry_rcu ?

Yes.

> > -		if (likely(get_nulls_value(head) == st->bucket)) {
> > -			if (++st->bucket >= st->htable_size)
> > -				return NULL;
> > +			++skip;
> >  		}
> > -		head = rcu_dereference(
> > -			hlist_nulls_first_rcu(&st->hash[st->bucket]));
> 
> This does not rewind if get_nulls_value(head) != st->bucket),
> not needed anymore?

There are only two choices:
1. rewind and (possibly) dump entries more than once
2. skip to next and miss an entry

I'm not sure whats worse/better.

  reply	other threads:[~2025-03-12 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 13:03 [PATCH nf-next] netfilter: nf_conntrack: speed up reads from nf_conntrack proc file Florian Westphal
2025-03-12 16:54 ` Pablo Neira Ayuso
2025-03-12 18:28   ` Florian Westphal [this message]
2025-03-12 19:45     ` Pablo Neira Ayuso
2025-03-12 21:39       ` 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=20250312182838.GB3007@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).