Skip to content

ip: Batch flushing uncached routes per batched device unregistration.

Kuniyuki Iwashima netdev 2 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 6 repliesApplied 6/6
  2. v22 patches 3 repliesSuperseded

Changes in v3 from the cover letter

* Add patch 1 ~ 4
* Patch 6
* Unlink routes only when both devices are blackhole_netdev
* Clarify netdev_run_todo() does not run before rt6_uncached_list is initialised
* Fix CONFIG_IPV6=n build

Patches in v3 All 6 applied

#Subject and filesSizeRepliesApplied
1/6net: Order blackhole_netdev_init(), inet_init(), and inet6_init().drivers/net/loopback.c net/ipv6/af_inet6.c+2 -21 replyApplied
2/6ipv4: Inline inet_blackhole_dev_init() to devinet_init().net/ipv4/devinet.c+5 -120 repliesApplied
3/6net: Rename dev_isalive() to netif_is_alive().include/linux/netdevice.h net/core/dev.h net/core/net-sysfs.c +2 more+17 -170 repliesApplied
4/6xfrm: Check netif_is_alive() in xfrm_bundle_create() and xfrm_create_dummy_bundle().net/xfrm/xfrm_policy.c+2 -20 repliesApplied
5/6ipv4: Batch rt_flush_dev() in netdev_run_todo().include/net/route.h net/core/dev.c net/ipv4/route.c+19 -21 replyApplied
6/6ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo().include/net/ip6_route.h net/core/dev.c net/ipv6/route.c+27 -91 replyApplied

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFernando Fernandez ManceraIdo SchimmelChris J Arges
SeriesR-b T-b
1/6R-b
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/6] ip: Batch flushing uncached routes per batched device unregistration.

Chris J Arges reported high RTNL contention during cleanup_net() caused by rt_flush_dev() and rt6_uncached_list_flush_dev() iterating over the global per-cpu uncached route lists for every netdev in dying netns [0].

This series resolves the issue by batching the uncached route cleanup after __rtnl_unlock() in netdev_run_todo()

[0]: https://lore.kernel.org/netdev/20260917-hash-bucket-route-lists-v3-0-30493a37b6eb@cloudflare.com/

Changelog:
v3:
* Add patch 1 ~ 4
* Patch 6
* Unlink routes only when both devices are blackhole_netdev
* Clarify netdev_run_todo() does not run before rt6_uncached_list is initialised
* Fix CONFIG_IPV6=n build

v2: https://lore.kernel.org/netdev/[email protected]/
* Drop ->pre_exit_batch()
* Do batching after setting NETDEV_UNREGISTERED in netdev_run_todo()

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (6):
net: Order blackhole_netdev_init(), inet_init(), and inet6_init().
ipv4: Inline inet_blackhole_dev_init() to devinet_init().
net: Rename dev_isalive() to netif_is_alive().
xfrm: Check netif_is_alive() in xfrm_bundle_create() and
xfrm_create_dummy_bundle().
ipv4: Batch rt_flush_dev() in netdev_run_todo().
ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo().

 drivers/net/loopback.c    |  2 +-
 include/linux/netdevice.h |  6 ++++++
 include/net/ip6_route.h   |  7 +++++++
 include/net/route.h       |  6 ++++++
 net/core/dev.c            |  7 +++++++
 net/core/dev.h            |  6 ------
 net/core/net-sysfs.c      | 16 ++++++++--------
 net/core/netdev_work.c    |  4 ++--
 net/core/rtnetlink.c      |  2 +-
 net/ipv4/devinet.c        | 17 +++++------------
 net/ipv4/route.c          | 11 +++++++++--
 net/ipv6/af_inet6.c       |  2 +-
 net/ipv6/route.c          | 24 ++++++++++++++++--------
 net/xfrm/xfrm_policy.c    |  4 ++--
 14 files changed, 71 insertions(+), 43 deletions(-)
Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog