All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Antoine Tenart <atenart@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	 Eric Dumazet <edumazet@google.com>
Subject: [PATCH v4 net-next 00/15] net: more factorization in cleanup_net() paths
Date: Tue,  6 Feb 2024 14:42:56 +0000	[thread overview]
Message-ID: <20240206144313.2050392-1-edumazet@google.com> (raw)

This series is inspired by recent syzbot reports hinting to RTNL and
workqueue abuses.

rtnl_lock() is unfair to (single threaded) cleanup_net(), because
many threads can cause contention on it.

This series adds a new (struct pernet_operations) method,
so that cleanup_net() can hold RTNL longer once it finally
acquires it.

It also factorizes unregister_netdevice_many(), to further
reduce stalls in cleanup_net().

v4: Changed geneve patch (Antoine Tenart feedback)
    Changed vxlan patch (Paolo Abeni feedback)
    Link: https://lore.kernel.org/netdev/CANn89iLJrrJs+6Vc==Un4rVKcpV0Eof4F_4w1_wQGxUCE2FWAg@mail.gmail.com/T/#u

v3: Dropped "net: convert default_device_exit_batch() to exit_batch_rtnl method"
    Jakub (and KASAN) reported issues with bridge, but the root cause was with this patch.
    default_device_exit_batch() is the catch-all method, it includes "lo" device dismantle.

v2: Antoine Tenart feedback in
      https://lore.kernel.org/netdev/170688415193.5216.10499830272732622816@kwain/
    - Added bond_net_pre_exit() method to make sure bond_destroy_sysfs()
      is called before we unregister the devices in bond_net_exit_batch_rtnl()


Eric Dumazet (15):
  net: add exit_batch_rtnl() method
  nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl method
  bareudp: use exit_batch_rtnl() method
  bonding: use exit_batch_rtnl() method
  geneve: use exit_batch_rtnl() method
  gtp: use exit_batch_rtnl() method
  ipv4: add __unregister_nexthop_notifier()
  vxlan: use exit_batch_rtnl() method
  ip6_gre: use exit_batch_rtnl() method
  ip6_tunnel: use exit_batch_rtnl() method
  ip6_vti: use exit_batch_rtnl() method
  sit: use exit_batch_rtnl() method
  ip_tunnel: use exit_batch_rtnl() method
  bridge: use exit_batch_rtnl() method
  xfrm: interface: use exit_batch_rtnl() method

 drivers/net/bareudp.c           | 13 +++------
 drivers/net/bonding/bond_main.c | 37 ++++++++++++++++--------
 drivers/net/geneve.c            | 23 +++++++--------
 drivers/net/gtp.c               | 20 ++++++-------
 drivers/net/vxlan/vxlan_core.c  | 50 +++++++++++++--------------------
 include/net/ip_tunnels.h        |  3 +-
 include/net/net_namespace.h     |  3 ++
 include/net/nexthop.h           |  1 +
 net/bridge/br.c                 | 15 ++++------
 net/core/net_namespace.c        | 31 +++++++++++++++++++-
 net/ipv4/ip_gre.c               | 24 ++++++++++------
 net/ipv4/ip_tunnel.c            | 10 +++----
 net/ipv4/ip_vti.c               |  8 ++++--
 net/ipv4/ipip.c                 |  8 ++++--
 net/ipv4/nexthop.c              | 38 ++++++++++++++++---------
 net/ipv6/ip6_gre.c              | 12 ++++----
 net/ipv6/ip6_tunnel.c           | 12 ++++----
 net/ipv6/ip6_vti.c              | 12 ++++----
 net/ipv6/sit.c                  | 13 ++++-----
 net/xfrm/xfrm_interface_core.c  | 14 ++++-----
 20 files changed, 190 insertions(+), 157 deletions(-)

-- 
2.43.0.594.gd9cf4e227d-goog


             reply	other threads:[~2024-02-06 14:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 14:42 Eric Dumazet [this message]
2024-02-06 14:42 ` [PATCH v4 net-next 01/15] net: add exit_batch_rtnl() method Eric Dumazet
2024-02-06 14:42 ` [PATCH net] ppp_async: limit MRU to 64K Eric Dumazet
2024-02-06 16:50   ` Eric Dumazet
2024-02-07  3:00   ` patchwork-bot+netdevbpf
2024-02-06 14:42 ` [PATCH v4 net-next 02/15] nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl method Eric Dumazet
2024-02-07 17:57   ` David Ahern
2024-02-06 14:43 ` [PATCH v4 net-next 03/15] bareudp: use exit_batch_rtnl() method Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 04/15] bonding: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 05/15] geneve: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 06/15] gtp: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 07/15] ipv4: add __unregister_nexthop_notifier() Eric Dumazet
2024-02-07 18:06   ` David Ahern
2024-02-06 14:43 ` [PATCH v4 net-next 08/15] vxlan: use exit_batch_rtnl() method Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 09/15] ip6_gre: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 10/15] ip6_tunnel: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 11/15] ip6_vti: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 12/15] sit: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 13/15] ip_tunnel: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 14/15] bridge: " Eric Dumazet
2024-02-06 14:43 ` [PATCH v4 net-next 15/15] xfrm: interface: " Eric Dumazet
2024-02-07 10:27 ` [PATCH v4 net-next 00/15] net: more factorization in cleanup_net() paths Antoine Tenart
2024-02-08  3:10 ` 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=20240206144313.2050392-1-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.