Thread (20 messages) 20 messages, 3 authors, 2017-02-04

Re: [PATCH RFC net-next 4/4] bridge: add ability to turn off fdb used updates

From: Nikolay Aleksandrov <hidden>
Date: 2017-02-03 08:30:39

On 03/02/17 03:47, David Miller wrote:
From: Nikolay Aleksandrov <redacted>
Date: Tue, 31 Jan 2017 16:31:58 +0100
quoted
@@ -197,7 +197,8 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		if (dst->is_local)
 			return br_pass_frame_up(skb);
 
-		dst->used = jiffies;
+		if (br->used_enabled)
+			dst->used = jiffies;
Have you tried:

	if (dst->used != jiffies)
		dst->used = jiffies;

If that isn't effective, you can tweak the test to decrease the
granularity of the value.  Basically, if dst->used is within
1 HZ of jiffies, don't do the write.

I suspect this might help a lot, and not require a new bridging
option.
Yes, I actually have a patch titled "used granularity". :-) I've tested with different
values and it does help but it either needs to be paired with another similar test for
the "updated" field (since they share a write-heavy cache line) or they need to be
in separate cache lines to avoid that dst's source port from causing the load HitM for
all who check the value.

I'll run some more tests and probably go this way for now.

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