Skip to content

ipmr: get rid of rwlocks

Eric Dumazet netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 4 repliesApplied 19/19
  2. v118 of 19 patches 1 replySuperseded

Patches in v2 All 19 applied

#Subject and filesSizeRepliesApplied
1/19ip6mr: do not get a device reference in pim6_rcv()net/ipv6/ip6mr.c+0 -20 repliesApplied
2/19ipmr: add rcu protection over (struct vif_device)->devinclude/linux/mroute_base.h net/ipv4/ipmr.c net/ipv4/ipmr_base.c +1 more+111 -770 repliesApplied
3/19ipmr: change igmpmsg_netlink_event() prototypenet/ipv4/ipmr.c+2 -20 repliesApplied
4/19ipmr: ipmr_cache_report() changesnet/ipv4/ipmr.c+29 -160 repliesApplied
5/19ipmr: do not acquire mrt_lock in __pim_rcv()net/ipv4/ipmr.c+5 -50 repliesApplied
6/19ipmr: do not acquire mrt_lock in ioctl(SIOCGETVIFCNT)net/ipv4/ipmr.c+22 -200 repliesApplied
7/19ipmr: do not acquire mrt_lock before calling ipmr_cache_unresolved()net/ipv4/ipmr.c+8 -170 repliesApplied
8/19ipmr: do not acquire mrt_lock while calling ip_mr_forward()net/ipv4/ipmr.c+2 -74 repliesApplied
9/19ipmr: do not acquire mrt_lock in ipmr_get_route()net/ipv4/ipmr.c+0 -20 repliesApplied
10/19ip6mr: ip6mr_cache_report() changesnet/ipv6/ip6mr.c+20 -150 repliesApplied
11/19ip6mr: do not acquire mrt_lock in pim6_rcv()net/ipv6/ip6mr.c+2 -30 repliesApplied
12/19ip6mr: do not acquire mrt_lock in ioctl(SIOCGETMIFCNT_IN6)net/ipv6/ip6mr.c+22 -200 repliesApplied
13/19ip6mr: do not acquire mrt_lock before calling ip6mr_cache_unresolvednet/ipv6/ip6mr.c+6 -60 repliesApplied
14/19ip6mr: do not acquire mrt_lock while calling ip6_mr_forward()net/ipv6/ip6mr.c+1 -90 repliesApplied
15/19ip6mr: switch ip6mr_get_route() to rcu_read_lock()net/ipv6/ip6mr.c+5 -50 repliesApplied
16/19ipmr: adopt rcu_read_lock() in mr_dump()include/linux/mroute_base.h net/ipv4/ipmr.c net/ipv4/ipmr_base.c +1 more+7 -90 repliesApplied
17/19ipmr: convert /proc handlers to rcu_read_lock()net/ipv4/ipmr.c net/ipv6/ip6mr.c+8 -80 repliesApplied
18/19ipmr: convert mrt_lock to a spinlocknet/ipv4/ipmr.c+9 -100 repliesApplied
19/19ip6mr: convert mrt_lock to a spinlocknet/ipv6/ip6mr.c+14 -150 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 00/19] ipmr: get rid of rwlocks

We need to get rid of rwlocks in networking stacks, if read_lock() is (ab)used from softirq context.

As discussed recently [1], rwlock are unfair by design in this case, and writers can starve and trigger soft lockups.

This series convert ipmr code (both IPv4 and IPv6 families) to RCU and spinlocks.

[1] https://lkml.org/lkml/2022/6/17/272

v2: fixed two typos, and resent because patch 19/19
did not make it to patchwork.

Eric Dumazet (19):
ip6mr: do not get a device reference in pim6_rcv()
ipmr: add rcu protection over (struct vif_device)->dev
ipmr: change igmpmsg_netlink_event() prototype
ipmr: ipmr_cache_report() changes
ipmr: do not acquire mrt_lock in __pim_rcv()
ipmr: do not acquire mrt_lock in ioctl(SIOCGETVIFCNT)
ipmr: do not acquire mrt_lock before calling ipmr_cache_unresolved()
ipmr: do not acquire mrt_lock while calling ip_mr_forward()
ipmr: do not acquire mrt_lock in ipmr_get_route()
ip6mr: ip6mr_cache_report() changes
ip6mr: do not acquire mrt_lock in pim6_rcv()
ip6mr: do not acquire mrt_lock in ioctl(SIOCGETMIFCNT_IN6)
ip6mr: do not acquire mrt_lock before calling ip6mr_cache_unresolved
ip6mr: do not acquire mrt_lock while calling ip6_mr_forward()
ip6mr: switch ip6mr_get_route() to rcu_read_lock()
ipmr: adopt rcu_read_lock() in mr_dump()
ipmr: convert /proc handlers to rcu_read_lock()
ipmr: convert mrt_lock to a spinlock
ip6mr: convert mrt_lock to a spinlock

 include/linux/mroute_base.h |  15 ++-
 net/ipv4/ipmr.c             | 215 +++++++++++++++++++-----------------
 net/ipv4/ipmr_base.c        |  53 +++++----
 net/ipv6/ip6mr.c            | 202 ++++++++++++++++-----------------
 4 files changed, 255 insertions(+), 230 deletions(-)
Signature · 1 line
2.37.0.rc0.104.g0611611a94-goog