net: bridge: mdb: arrange internal structs so fast-path fields are close
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 7 Sep 2020 09:56:05 +0000 (12:56 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 7 Sep 2020 20:16:34 +0000 (13:16 -0700)
Before this patch we'd need 2 cache lines for fast-path, now all used
fields are in the first cache line.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_private.h

index baa1500f384fc6de571ec33dae7cc13df990c9f4..357b6905ecefc7925f2e66f82dea36d880491078 100644 (file)
@@ -217,23 +217,27 @@ struct net_bridge_fdb_entry {
 struct net_bridge_port_group {
        struct net_bridge_port          *port;
        struct net_bridge_port_group __rcu *next;
-       struct hlist_node               mglist;
-       struct rcu_head                 rcu;
-       struct timer_list               timer;
        struct br_ip                    addr;
        unsigned char                   eth_addr[ETH_ALEN] __aligned(2);
        unsigned char                   flags;
+
+       struct timer_list               timer;
+       struct hlist_node               mglist;
+
+       struct rcu_head                 rcu;
 };
 
 struct net_bridge_mdb_entry {
        struct rhash_head               rhnode;
        struct net_bridge               *br;
        struct net_bridge_port_group __rcu *ports;
-       struct rcu_head                 rcu;
-       struct timer_list               timer;
        struct br_ip                    addr;
        bool                            host_joined;
+
+       struct timer_list               timer;
        struct hlist_node               mdb_node;
+
+       struct rcu_head                 rcu;
 };
 
 struct net_bridge_port {