net: mark some potential candidates __read_mostly
authorDaniel Borkmann <dborkman@redhat.com>
Thu, 29 Jan 2015 11:15:03 +0000 (12:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jan 2015 01:58:39 +0000 (17:58 -0800)
They are all either written once or extremly rarely (e.g. from init
code), so we can move them to the .data..read_mostly section.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_core.c
net/bridge/br_netlink.c
net/ipv4/devinet.c
net/ipv6/addrconf.c
net/mpls/mpls_gso.c

index 2e195289ddf4cf4ae4bab1c6fd0068789a60f8ed..2a175006028b347efe1fbe6d145f311f78c80bd7 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "ipvlan.h"
 
-static u32 ipvlan_jhash_secret;
+static u32 ipvlan_jhash_secret __read_mostly;
 
 void ipvlan_init_secret(void)
 {
index 3875ea51f6fe8d22402f24e3650c466f312fe19f..e08b260f33fe032d114bf05a5320ac5d253889d3 100644 (file)
@@ -701,7 +701,7 @@ static size_t br_get_link_af_size(const struct net_device *dev)
        return pv->num_vlans * nla_total_size(sizeof(struct bridge_vlan_info));
 }
 
-static struct rtnl_af_ops br_af_ops = {
+static struct rtnl_af_ops br_af_ops __read_mostly = {
        .family                 = AF_BRIDGE,
        .get_link_af_size       = br_get_link_af_size,
 };
index 59ebe16d06fc2db1c0a3a1d8d2ac3d1c74646c3b..f0b4a31d7bd6d23b114600ad454fa79c25945fe7 100644 (file)
@@ -2322,7 +2322,7 @@ static __net_initdata struct pernet_operations devinet_ops = {
        .exit = devinet_exit_net,
 };
 
-static struct rtnl_af_ops inet_af_ops = {
+static struct rtnl_af_ops inet_af_ops __read_mostly = {
        .family           = AF_INET,
        .fill_link_af     = inet_fill_link_af,
        .get_link_af_size = inet_get_link_af_size,
index 7dcc065e216021c04ef2efebe165a87209c63fd9..8623118cb2bbc1e12837e732cd5a89ded8d53649 100644 (file)
@@ -5405,7 +5405,7 @@ static struct pernet_operations addrconf_ops = {
        .exit = addrconf_exit_net,
 };
 
-static struct rtnl_af_ops inet6_ops = {
+static struct rtnl_af_ops inet6_ops __read_mostly = {
        .family           = AF_INET6,
        .fill_link_af     = inet6_fill_link_af,
        .get_link_af_size = inet6_get_link_af_size,
index 349295d21946d0072fb6a0a6bada3bd45d54f95f..809df534a7204916f10203ce55dcc3fdc0fe7b51 100644 (file)
@@ -60,14 +60,14 @@ out:
        return segs;
 }
 
-static struct packet_offload mpls_mc_offload = {
+static struct packet_offload mpls_mc_offload __read_mostly = {
        .type = cpu_to_be16(ETH_P_MPLS_MC),
        .callbacks = {
                .gso_segment    =       mpls_gso_segment,
        },
 };
 
-static struct packet_offload mpls_uc_offload = {
+static struct packet_offload mpls_uc_offload __read_mostly = {
        .type = cpu_to_be16(ETH_P_MPLS_UC),
        .callbacks = {
                .gso_segment    =       mpls_gso_segment,