Commit 83a718d6 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

bridge: fdb: write to used and updated at most once per jiffy

Writing once per jiffy is enough to limit the bridge's false sharing.
After this change the bridge doesn't show up in the local load HitM stats.
Suggested-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1214628c
...@@ -597,6 +597,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, ...@@ -597,6 +597,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
fdb->dst = source; fdb->dst = source;
fdb_modified = true; fdb_modified = true;
} }
if (jiffies != fdb->updated)
fdb->updated = jiffies; fdb->updated = jiffies;
if (unlikely(added_by_user)) if (unlikely(added_by_user))
fdb->added_by_user = 1; fdb->added_by_user = 1;
......
...@@ -198,6 +198,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb ...@@ -198,6 +198,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
if (dst->is_local) if (dst->is_local)
return br_pass_frame_up(skb); return br_pass_frame_up(skb);
if (jiffies != dst->used)
dst->used = jiffies; dst->used = jiffies;
br_forward(dst->dst, skb, local_rcv, false); br_forward(dst->dst, skb, local_rcv, false);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment