mbox series

[v2,net-next,00/19] ipmr: get rid of rwlocks

Message ID 20220623043449.1217288-1-edumazet@google.com (mailing list archive)
Headers show
Series ipmr: get rid of rwlocks | expand

Message

Eric Dumazet June 23, 2022, 4:34 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 24, 2022, 10:50 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 23 Jun 2022 04:34:30 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v2,net-next,01/19] ip6mr: do not get a device reference in pim6_rcv()
    https://git.kernel.org/netdev/net-next/c/0a24c43f54b2
  - [v2,net-next,02/19] ipmr: add rcu protection over (struct vif_device)->dev
    https://git.kernel.org/netdev/net-next/c/ebc3197963fc
  - [v2,net-next,03/19] ipmr: change igmpmsg_netlink_event() prototype
    https://git.kernel.org/netdev/net-next/c/0b490b51d226
  - [v2,net-next,04/19] ipmr: ipmr_cache_report() changes
    https://git.kernel.org/netdev/net-next/c/646679881a02
  - [v2,net-next,05/19] ipmr: do not acquire mrt_lock in __pim_rcv()
    https://git.kernel.org/netdev/net-next/c/121fefc669bf
  - [v2,net-next,06/19] ipmr: do not acquire mrt_lock in ioctl(SIOCGETVIFCNT)
    https://git.kernel.org/netdev/net-next/c/559260fd9d9a
  - [v2,net-next,07/19] ipmr: do not acquire mrt_lock before calling ipmr_cache_unresolved()
    https://git.kernel.org/netdev/net-next/c/9094db4b8004
  - [v2,net-next,08/19] ipmr: do not acquire mrt_lock while calling ip_mr_forward()
    https://git.kernel.org/netdev/net-next/c/4eadb88244d1
  - [v2,net-next,09/19] ipmr: do not acquire mrt_lock in ipmr_get_route()
    https://git.kernel.org/netdev/net-next/c/e4cd9868e8ec
  - [v2,net-next,10/19] ip6mr: ip6mr_cache_report() changes
    https://git.kernel.org/netdev/net-next/c/3493a5b730e5
  - [v2,net-next,11/19] ip6mr: do not acquire mrt_lock in pim6_rcv()
    https://git.kernel.org/netdev/net-next/c/6d08658736fc
  - [v2,net-next,12/19] ip6mr: do not acquire mrt_lock in ioctl(SIOCGETMIFCNT_IN6)
    https://git.kernel.org/netdev/net-next/c/638cf4a24a09
  - [v2,net-next,13/19] ip6mr: do not acquire mrt_lock before calling ip6mr_cache_unresolved
    https://git.kernel.org/netdev/net-next/c/db9eb7c8ae34
  - [v2,net-next,14/19] ip6mr: do not acquire mrt_lock while calling ip6_mr_forward()
    https://git.kernel.org/netdev/net-next/c/9b1c21d898fd
  - [v2,net-next,15/19] ip6mr: switch ip6mr_get_route() to rcu_read_lock()
    https://git.kernel.org/netdev/net-next/c/6fa40a290219
  - [v2,net-next,16/19] ipmr: adopt rcu_read_lock() in mr_dump()
    https://git.kernel.org/netdev/net-next/c/194366b28b83
  - [v2,net-next,17/19] ipmr: convert /proc handlers to rcu_read_lock()
    https://git.kernel.org/netdev/net-next/c/b96ef16d2f83
  - [v2,net-next,18/19] ipmr: convert mrt_lock to a spinlock
    https://git.kernel.org/netdev/net-next/c/3f55211ecf6a
  - [v2,net-next,19/19] ip6mr: convert mrt_lock to a spinlock
    https://git.kernel.org/netdev/net-next/c/a96f7a6a60b3

You are awesome, thank you!