Skip to contentSkip to conversation

netfilter: hashlimit and recent net_id are mostly read

PATCH New Eric Dumazet 1 participant 1 message Nov 21, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: hashlimit and recent net_id are mostly read

Make sure hashlimit_net_id and recent_net_id dont sit in an often written cache line.

---
 net/netfilter/xt_hashlimit.c |    2 +-
 net/netfilter/xt_recent.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/xt_hashlimit.c +1 -1
index 9228ee0..20ada88 100644
@@ -48,7 +48,7 @@ struct hashlimit_net {
 	struct proc_dir_entry	*ip6t_hashlimit;
 };
 
-static int hashlimit_net_id;
+static int hashlimit_net_id __read_mostly;
 static inline struct hashlimit_net *hashlimit_pernet(struct net *net)
 {
 	return net_generic(net, hashlimit_net_id);
net/netfilter/xt_recent.c +1 -1
index d2ff15a..8ae475e 100644
@@ -88,7 +88,7 @@ struct recent_net {
 #endif
 };
 
-static int recent_net_id;
+static int recent_net_id __read_mostly;
 static inline struct recent_net *recent_pernet(struct net *net)
 {
 	return net_generic(net, recent_net_id);