Thread (1 message) 1 message, 1 author, 2021-08-17

Re: [PATCH] net: Improve perf of bond/vlans modification

From: Gilad Naaman <hidden>
Date: 2021-08-17 12:19:49

On 17 Aug 2021, at 14:39, Nikolay Aleksandrov [off-list ref] wrote:

On 17/08/2021 14:04, Gilad Naaman wrote:
quoted
When a bond have a massive amount of VLANs with IPv6 addresses,
performance of changing link state, attaching a VRF, changing an IPv6
address, etc. go down dramtically.

The source of most of the slow down is the `dev_addr_lists.c` module,
which mainatins a linked list of HW addresses.
When using IPv6, this list grows for each IPv6 address added on a
VLAN, since each IPv6 address has a multicast HW address associated with
it.

When performing any modification to the involved links, this list is
traversed many times, often for nothing, all while holding the RTNL
lock.

Instead, this patch adds an auxilliary rbtree which cuts down
traversal time significantly.
[snip]
quoted
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Lu Wei <redacted>
Cc: Xiongfeng Wang <redacted>
Cc: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Gilad Naaman <redacted>
---
Hi Gilad,
Generally I like the idea, I have a similar hacky patch for the same reason but related to bridge
static entries which in some cases get added to lower device addr lists causing soft lockups due
to the list traversals.

The patch should be targeted at net-next, more comments below…
Hi Nikolay,
Thanks for the review, I will retarget the patch.
quoted
+	/* Auxiliary tree for faster lookup when modifying the structure */
+	struct rb_root		tree_root;
Why keep the list when now we have the rbtree ?
I was about to say that the list is used in RCU contexts,
but in retrospect rbtree can also be used with RCU, so there’s no real reason to keep the list.

I’ll work on implementing this, but I fear I don’t have ability to test all downstream
users of this module.
quoted
+
+	/* Insert node to hash table for quicker lookups during modification */
hash table?
Oops, my earlier implantation is showing.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help