aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-06-08 08:11:19 -0400
committerPatrick McHardy <kaber@trash.net>2010-06-08 08:11:19 -0400
commit339bb99e4a8ba1f8960eed21d50be808b35ad22a (patch)
tree077f679c919b00331569622e035a822e94492377 /include/net
parente12f8e29a8526172b7715881503bae636d60bdd8 (diff)
netfilter: xt_rateest: Better struct xt_rateest layout
We currently dirty two cache lines in struct xt_rateest, this hurts SMP performance. This patch moves lock/bstats/rstats at beginning of structure so that they share a single cache line. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/xt_rateest.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h
index ddbf37e19616..b1d780e21ce3 100644
--- a/include/net/netfilter/xt_rateest.h
+++ b/include/net/netfilter/xt_rateest.h
@@ -2,13 +2,17 @@
2#define _XT_RATEEST_H 2#define _XT_RATEEST_H
3 3
4struct xt_rateest { 4struct xt_rateest {
5 /* keep lock and bstats on same cache line to speedup xt_rateest_tg() */
6 struct gnet_stats_basic_packed bstats;
7 spinlock_t lock;
8 /* keep rstats and lock on same cache line to speedup xt_rateest_mt() */
9 struct gnet_stats_rate_est rstats;
10
11 /* following fields not accessed in hot path */
5 struct hlist_node list; 12 struct hlist_node list;
6 char name[IFNAMSIZ]; 13 char name[IFNAMSIZ];
7 unsigned int refcnt; 14 unsigned int refcnt;
8 spinlock_t lock;
9 struct gnet_estimator params; 15 struct gnet_estimator params;
10 struct gnet_stats_rate_est rstats;
11 struct gnet_stats_basic_packed bstats;
12}; 16};
13 17
14extern struct xt_rateest *xt_rateest_lookup(const char *name); 18extern struct xt_rateest *xt_rateest_lookup(const char *name);