netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Gilad Naaman <gnaaman@drivenets.com>
Cc: netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Kuniyuki Iwashima <kuniyu@amazon.com>
Subject: Re: [PATCH net-next v6 0/6] neighbour: Improve neigh_flush_dev performance
Date: Mon, 21 Oct 2024 11:04:59 -0700	[thread overview]
Message-ID: <ZxaXyx4wV0EyN52R@mini-arch> (raw)
In-Reply-To: <20241021102102.2560279-1-gnaaman@drivenets.com>

On 10/21, Gilad Naaman wrote:
> This patchsets improves the performance of neigh_flush_dev.
> 
> Currently, the only way to implement it requires traversing
> all neighbours known to the kernel, across all network-namespaces.
> 
> This means that some flows are slowed down as a function of neighbour-scale,
> even if the specific link they're handling has little to no neighbours.
> 
> In order to solve this, this patchset adds a netdev->neighbours list,
> as well as making the original linked-list doubly-, so that it is
> possible to unlink neighbours without traversing the hash-bucket to
> obtain the previous neighbour.
> 
> The original use-case we encountered was mass-deletion of links (12K
> VLANs) while there are 50K ARPs and 50K NDPs in the system; though the
> slowdowns would also appear when the links are set down.
> 
> Changes in v6:
> 
>  - Reverse changes to mellanox driver
>  - Rename iteration macros to emphasize `in_bucket`
>  - Remove now-unused variables and parameters
> 
> Gilad Naaman (6):
>   neighbour: Add hlist_node to struct neighbour
>   neighbour: Define neigh_for_each_in_bucket
>   neighbour: Convert seq_file functions to use hlist
>   neighbour: Convert iteration to use hlist+macro
>   neighbour: Remove bare neighbour::next pointer
>   neighbour: Create netdev->neighbour association
> 
>  .../networking/net_cachelines/net_device.rst  |   1 +
>  include/linux/netdevice.h                     |   7 +
>  include/net/neighbour.h                       |  24 +-
>  include/net/neighbour_tables.h                |  12 +
>  net/core/neighbour.c                          | 338 ++++++++----------
>  net/ipv4/arp.c                                |   2 +-
>  6 files changed, 175 insertions(+), 209 deletions(-)
>  create mode 100644 include/net/neighbour_tables.h

Seems like the series triggers a bunch of GPFs from
tools/testing/selftests/net/fib_tests.sh:

[  698.336499] Oops: general protection fault, probably for non-canonical address 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI
...
[  698.336743] RIP: 0010:neigh_flush_dev.isra.0+0x5d/0x1a0
...
[  698.337531] Call Trace:
[  698.337560]  <TASK>
[  698.337586]  ? die_addr+0x37/0x90
[  698.337626]  ? exc_general_protection+0x1b7/0x3b0
[  698.337674]  ? asm_exc_general_protection+0x26/0x30
[  698.337721]  ? neigh_flush_dev.isra.0+0x5d/0x1a0
[  698.337760]  __neigh_ifdown.isra.0+0x33/0x120
[  698.337798]  neigh_ifdown+0x10/0x20
[  698.337827]  fib_netdev_event+0xa1/0x1a0
[  698.337868]  notifier_call_chain+0x5b/0xd0
[  698.337907]  dev_close_many+0xef/0x160
[  698.337946]  unregister_netdevice_many_notify+0x155/0x910
[  698.337990]  ? sock_def_readable+0x14/0xc0
[  698.338024]  ? __netlink_sendskb+0x64/0x90
[  698.338061]  rtnl_dellink+0x14d/0x3a0
[  698.338101]  ? rtnl_getlink+0x376/0x400
[  698.338139]  ? __rtnl_unlock+0x37/0x70
[  698.338170]  ? netdev_run_todo+0x64/0x550
[  698.338201]  rtnetlink_rcv_msg+0x15d/0x410
[  698.338234]  ? get_page_from_freelist+0xf04/0x10c0
[  698.338278]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10
[  698.338315]  netlink_rcv_skb+0x58/0x110
[  698.338351]  netlink_unicast+0x247/0x370
[  698.338384]  netlink_sendmsg+0x1bf/0x3e0
[  698.338414]  ____sys_sendmsg+0x2bc/0x320

https://netdev.bots.linux.dev/contest.html?branch=net-next-2024-10-21--15-00&executor=vmksft-net&pw-n=0&pass=0

Can you please take a look?

---
pw-bot: cr

  parent reply	other threads:[~2024-10-21 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 10:20 [PATCH net-next v6 0/6] neighbour: Improve neigh_flush_dev performance Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 1/6] neighbour: Add hlist_node to struct neighbour Gilad Naaman
2024-10-21 19:11   ` Kuniyuki Iwashima
2024-10-21 19:36     ` Gilad Naaman
2024-10-21 19:40       ` Kuniyuki Iwashima
2024-10-21 10:20 ` [PATCH net-next v6 2/6] neighbour: Define neigh_for_each_in_bucket Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 3/6] neighbour: Convert seq_file functions to use hlist Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 4/6] neighbour: Convert iteration to use hlist+macro Gilad Naaman
2024-10-21 19:21   ` Kuniyuki Iwashima
2024-10-21 10:20 ` [PATCH net-next v6 5/6] neighbour: Remove bare neighbour::next pointer Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 6/6] neighbour: Create netdev->neighbour association Gilad Naaman
2024-10-21 18:04 ` Stanislav Fomichev [this message]
2024-10-22 11:21   ` [PATCH net-next v6 0/6] neighbour: Improve neigh_flush_dev performance Gilad Naaman

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=ZxaXyx4wV0EyN52R@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gnaaman@drivenets.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).