]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
bridge: fdb: write to used and updated at most once per jiffy
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Sat, 4 Feb 2017 17:05:09 +0000 (18:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Feb 2017 03:53:13 +0000 (22:53 -0500)
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: David S. Miller <davem@davemloft.net>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_fdb.c
net/bridge/br_input.c

index 5cbed5c0db88a95d39fa6d558c865f031cd9d78a..5028691fa68a65a7abb959605c8dd988297c0660 100644 (file)
@@ -597,7 +597,8 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
                                fdb->dst = source;
                                fdb_modified = true;
                        }
-                       fdb->updated = jiffies;
+                       if (jiffies != fdb->updated)
+                               fdb->updated = jiffies;
                        if (unlikely(added_by_user))
                                fdb->added_by_user = 1;
                        if (unlikely(fdb_modified))
index fba38d8a1a084455f9da82e6f5022294b99ed105..220943f920d272113d2d22392197078ac5b75527 100644 (file)
@@ -198,7 +198,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 (jiffies != dst->used)
+                       dst->used = jiffies;
                br_forward(dst->dst, skb, local_rcv, false);
        } else {
                if (!mcast_hit)