netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Eric Dumazet <edumazet@google.com>
Cc: yushengjin <yushengjin@uniontech.com>,
	pablo@netfilter.org, kadlec@netfilter.org, roopa@nvidia.com,
	razor@blackwall.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, bridge@lists.linux.dev,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] net/bridge: Optimizing read-write locks in ebtables.c
Date: Tue, 24 Sep 2024 09:40:54 -0700	[thread overview]
Message-ID: <20240924094054.2d005c76@fedora> (raw)
In-Reply-To: <CANn89iLoBYjMmot=6e_WJrtEhcAzWikU2eV0eQExHPj7+ObGKA@mail.gmail.com>

On Tue, 24 Sep 2024 15:46:17 +0200
Eric Dumazet <edumazet@google.com> wrote:

> On Tue, Sep 24, 2024 at 3:33 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Tue, 24 Sep 2024 17:09:06 +0800
> > yushengjin <yushengjin@uniontech.com> wrote:
> >  
> > > When conducting WRK testing, the CPU usage rate of the testing machine was
> > > 100%. forwarding through a bridge, if the network load is too high, it may
> > > cause abnormal load on the ebt_do_table of the kernel ebtable module, leading
> > > to excessive soft interrupts and sometimes even directly causing CPU soft
> > > deadlocks.
> > >
> > > After analysis, it was found that the code of ebtables had not been optimized
> > > for a long time, and the read-write locks inside still existed. However, other
> > > arp/ip/ip6 tables had already been optimized a lot, and performance bottlenecks
> > > in read-write locks had been discovered a long time ago.
> > >
> > > Ref link: https://lore.kernel.org/lkml/20090428092411.5331c4a1@nehalam/
> > >
> > > So I referred to arp/ip/ip6 modification methods to optimize the read-write
> > > lock in ebtables.c.  
> >
> > What about doing RCU instead, faster and safer.  
> 
> Safer ? How so ?
> 
> Stephen, we have used this stuff already in other netfilter components
> since 2011
> 
> No performance issue at all.
> 

I was thinking that lockdep and analysis tools do better job looking at RCU.
Most likely, the number of users of ebtables was small enough that nobody looked
hard at it until now.



  reply	other threads:[~2024-09-24 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24  9:09 [PATCH v3] net/bridge: Optimizing read-write locks in ebtables.c yushengjin
2024-09-24 13:32 ` Stephen Hemminger
2024-09-24 13:46   ` Eric Dumazet
2024-09-24 16:40     ` Stephen Hemminger [this message]
2024-09-25  7:45       ` yushengjin

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=20240924094054.2d005c76@fedora \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux.dev \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    --cc=yushengjin@uniontech.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).