Skip to content

ip: Batch flushing uncached routes for dying netns.

Kuniyuki Iwashima netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: Remove net->is_dying.include/net/net_namespace.h net/core/net_namespace.c+1 -30 replies
2/5net: Add ->pre_exit_batch() to struct pernet_operations.include/net/net_namespace.h net/core/net_namespace.c+4 -00 replies
3/5net: Track state in ops_undo_list().include/net/net_namespace.h net/core/net_namespace.c+16 -00 replies
4/5ipv4: Batch rt_flush_dev() for dying netns.net/ipv4/fib_frontend.c net/ipv4/route.c+29 -52 replies
5/5ipv6: Batch rt6_uncached_list_flush_dev() for dying netns.net/ipv6/route.c+39 -150 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH v1 net-next 0/5] ip: Batch flushing uncached routes for dying netns.

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 introducing a new ->pre_exit_batch() hook in struct pernet_operations and batching the uncached route cleanup once per cleanup_net() without holding RTNL.

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

Kuniyuki Iwashima (5):
net: Remove net->is_dying.
net: Add ->pre_exit_batch() to struct pernet_operations.
net: Track state in ops_undo_list().
ipv4: Batch rt_flush_dev() for dying netns.
ipv6: Batch rt6_uncached_list_flush_dev() for dying netns.

 include/net/net_namespace.h | 11 +++++++-
 net/core/net_namespace.c    | 13 +++++++--
 net/ipv4/fib_frontend.c     |  6 +++++
 net/ipv4/route.c            | 28 +++++++++++++++----
 net/ipv6/route.c            | 54 ++++++++++++++++++++++++++-----------
 5 files changed, 89 insertions(+), 23 deletions(-)
Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog