From: Florian Westphal <fw@strlen.de>
To: William Tu <u9012063@gmail.com>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de,
Yifeng Sun <pkusunyifeng@gmail.com>,
Greg Rose <gvrose8192@gmail.com>
Subject: Re: [PATCH] netfilter: nf_conncount: reduce unnecessary GC
Date: Wed, 4 May 2022 08:07:45 +0200 [thread overview]
Message-ID: <20220504060745.GB32684@breakpoint.cc> (raw)
In-Reply-To: <20220503215237.98485-1-u9012063@gmail.com>
William Tu <u9012063@gmail.com> wrote:
> @@ -231,6 +236,12 @@ bool nf_conncount_gc_list(struct net *net,
> if (!spin_trylock(&list->list_lock))
> return false;
>
> + /* don't bother if we just done GC */
> + if (time_after_eq(list->last_gc, jiffies)) {
> + spin_unlock(&list->list_lock);
Minor nit, I think you could place the time_after_eq test before
the spin_trylock if you do wrap the list->last_gc read with READ_ONCE().
You could also check if changing last_gc to u32 and placing it after
the "list_lock" member prevents growth of the list structure.
next prev parent reply other threads:[~2022-05-04 6:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 21:52 [PATCH] netfilter: nf_conncount: reduce unnecessary GC William Tu
2022-05-04 6:07 ` Florian Westphal [this message]
2022-05-04 15:45 ` William Tu
-- strict thread matches above, loose matches on Subject: below --
2022-05-04 1:09 William Tu
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=20220504060745.GB32684@breakpoint.cc \
--to=fw@strlen.de \
--cc=gvrose8192@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pkusunyifeng@gmail.com \
--cc=u9012063@gmail.com \
/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).