netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v2 net-next 0/2] raw: RCU conversion
Date: Fri, 17 Jun 2022 20:47:03 -0700	[thread overview]
Message-ID: <20220618034705.2809237-1-eric.dumazet@gmail.com> (raw)

From: Eric Dumazet <edumazet@google.com>

Using rwlock in networking code is extremely risky.
writers can starve if enough readers are constantly
grabing the rwlock.

I thought rwlock were at fault and sent this patch:

https://lkml.org/lkml/2022/6/17/272

But Peter and Linus essentially told me rwlock had to be unfair.

We need to get rid of rwlock in networking stacks.

Without this conversion, following script triggers soft lockups:

for i in {1..48}
do
 ping -f -n -q 127.0.0.1 &
 sleep 0.1
done

Next step will be to convert ping sockets to RCU as well.

v2: small issue in first patch, detected by kernel bot
    Polish second patch in net/ipv4/raw_diag.c

Eric Dumazet (2):
  raw: use more conventional iterators
  raw: convert raw sockets to RCU

 include/net/raw.h   |  16 +++--
 include/net/rawv6.h |   7 +-
 net/ipv4/af_inet.c  |   2 +
 net/ipv4/raw.c      | 162 +++++++++++++++++---------------------------
 net/ipv4/raw_diag.c |  53 ++++++++-------
 net/ipv6/af_inet6.c |   3 +
 net/ipv6/raw.c      | 119 ++++++++++++--------------------
 7 files changed, 157 insertions(+), 205 deletions(-)

-- 
2.36.1.476.g0c4daa206d-goog


             reply	other threads:[~2022-06-18  3:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18  3:47 Eric Dumazet [this message]
2022-06-18  3:47 ` [PATCH v2 net-next 1/2] raw: use more conventional iterators Eric Dumazet
2022-06-18  3:47 ` [PATCH v2 net-next 2/2] raw: convert raw sockets to RCU Eric Dumazet
2022-06-19  9:10 ` [PATCH v2 net-next 0/2] raw: RCU conversion patchwork-bot+netdevbpf

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=20220618034705.2809237-1-eric.dumazet@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).