Skip to content

raw: RCU conversion

Eric Dumazet netdev 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew 1 of 2 applied
  2. v12 patches 0 repliesSuperseded

Patches in v2 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2raw: use more conventional iteratorsinclude/net/raw.h include/net/rawv6.h net/ipv4/raw.c +2 more+92 -1500 replies
2/2raw: convert raw sockets to RCUinclude/net/raw.h include/net/rawv6.h net/ipv4/af_inet.c +4 more+80 -700 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/2] raw: RCU conversion

From: Eric Dumazet <[email protected]>

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(-)
Signature · 1 line
2.36.1.476.g0c4daa206d-goog