From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org, netdev <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH nf] netfilter: conntrack: serialize hash resizes and cleanups
Date: Sun, 19 Sep 2021 11:20:02 +0200 [thread overview]
Message-ID: <20210919092002.GG15906@breakpoint.cc> (raw)
In-Reply-To: <20210917221556.1162846-1-eric.dumazet@gmail.com>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Syzbot was able to trigger the following warning [1]
>
> No repro found by syzbot yet but I was able to trigger similar issue
> by having 2 scripts running in parallel, changing conntrack hash sizes,
> and:
>
> for j in `seq 1 1000` ; do unshare -n /bin/true >/dev/null ; done
>
> It would take more than 5 minutes for net_namespace structures
> to be cleaned up.
>
> This is because nf_ct_iterate_cleanup() has to restart everytime
> a resize happened.
>
> By adding a mutex, we can serialize hash resizes and cleanups
> and also make get_next_corpse() faster by skipping over empty
> buckets.
>
> Even without resizes in the picture, this patch considerably
> speeds up network namespace dismantles.
LGTM, thanks Eric.
I have been working on patches to make hash table pernet again,
but they will take a bit more time to finish and are not suited for -net.
next prev parent reply other threads:[~2021-09-19 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 22:15 [PATCH nf] netfilter: conntrack: serialize hash resizes and cleanups Eric Dumazet
2021-09-19 9:20 ` Florian Westphal [this message]
2021-09-21 1:51 ` Pablo Neira Ayuso
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=20210919092002.GG15906@breakpoint.cc \
--to=fw@strlen.de \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kadlec@blackhole.kfki.hu \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=syzkaller@googlegroups.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 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.