netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gilad Naaman <gnaaman@drivenets.com>
To: 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>
Cc: Gilad Naaman <gnaaman@drivenets.com>
Subject: [PATCH net-next v8 0/6] Improve neigh_flush_dev performance
Date: Mon,  4 Nov 2024 08:04:28 +0000	[thread overview]
Message-ID: <20241104080437.103-1-gnaaman@drivenets.com> (raw)

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 neigh-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 v8:

 - Rebase and absorb alloc_pages->kvzalloc changes

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                          | 325 ++++++++----------
 net/ipv4/arp.c                                |   2 +-
 6 files changed, 168 insertions(+), 203 deletions(-)
 create mode 100644 include/net/neighbour_tables.h

-- 
2.34.1


             reply	other threads:[~2024-11-04  8:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  8:04 Gilad Naaman [this message]
2024-11-04  8:04 ` [PATCH net-next v8 1/6] neighbour: Add hlist_node to struct neighbour Gilad Naaman
2024-11-06 20:26   ` Kuniyuki Iwashima
2024-11-04  8:04 ` [PATCH net-next v8 2/6] neighbour: Define neigh_for_each_in_bucket Gilad Naaman
2024-11-06 20:28   ` Kuniyuki Iwashima
2024-11-04  8:04 ` [PATCH net-next v8 3/6] neighbour: Convert seq_file functions to use hlist Gilad Naaman
2024-11-06 20:34   ` Kuniyuki Iwashima
2024-11-04  8:04 ` [PATCH net-next v8 4/6] neighbour: Convert iteration to use hlist+macro Gilad Naaman
2024-11-06 20:40   ` Kuniyuki Iwashima
2024-11-06 23:07   ` Kuniyuki Iwashima
2024-11-07  5:39     ` Gilad Naaman
2024-11-07  5:48       ` Kuniyuki Iwashima
2024-11-04  8:04 ` [PATCH net-next v8 5/6] neighbour: Remove bare neighbour::next pointer Gilad Naaman
2024-11-06 23:15   ` Kuniyuki Iwashima
2024-11-04  8:04 ` [PATCH net-next v8 6/6] neighbour: Create netdev->neighbour association 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=20241104080437.103-1-gnaaman@drivenets.com \
    --to=gnaaman@drivenets.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.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).