aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-12-02 20:25:53 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 15:14:34 -0500
commitd285834001df372f81045bb41092e54943e93c84 (patch)
tree171c1e6c6a90874cab7cd3ed592e3688ae1cfb79
parentff236f7af82fae0818d7cbb5a0717d3218d00bdd (diff)
net 01/05: fib_rules: rearrange struct fib_rule
commit b8952893d5d86f69c4e499d191b98c6658f64b0f Author: Patrick McHardy <kaber@trash.net> Date: Thu Dec 3 12:05:22 2009 +0100 net: fib_rules: rearrange struct fib_rule The ifname member is only used to resolve interface names and is not needed during rule lookups. The target and ctarget members however are used during rule lookups and are currently located in a second cacheline. Move ifname further to the end to make sure both target and ctarget are located in the same cacheline as other members used during rule lookups. The layout on 64 bit changes from: struct fib_rule { ... u32 table; /* 56 4 */ u8 action; /* 60 1 */ /* XXX 3 bytes hole, try to pack */ /* --- cacheline 1 boundary (64 bytes) --- */ u32 target; /* 64 4 */ /* XXX 4 bytes hole, try to pack */ struct fib_rule * ctarget; /* 72 8 */ struct rcu_head rcu; /* 80 16 */ struct net * fr_net; /* 96 8 */ }; to: struct fib_rule { ... u32 table; /* 40 4 */ u8 action; /* 44 1 */ /* XXX 3 bytes hole, try to pack */ u32 target; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ struct fib_rule * ctarget; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ char ifname[16]; /* 64 16 */ struct rcu_head rcu; /* 80 16 */ struct net * fr_net; /* 96 8 */ }; Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/fib_rules.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 2cd707b15d59..22fb323cd85e 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -11,7 +11,6 @@ struct fib_rule {
11 struct list_head list; 11 struct list_head list;
12 atomic_t refcnt; 12 atomic_t refcnt;
13 int ifindex; 13 int ifindex;
14 char ifname[IFNAMSIZ];
15 u32 mark; 14 u32 mark;
16 u32 mark_mask; 15 u32 mark_mask;
17 u32 pref; 16 u32 pref;
@@ -20,6 +19,7 @@ struct fib_rule {
20 u8 action; 19 u8 action;
21 u32 target; 20 u32 target;
22 struct fib_rule * ctarget; 21 struct fib_rule * ctarget;
22 char ifname[IFNAMSIZ];
23 struct rcu_head rcu; 23 struct rcu_head rcu;
24 struct net * fr_net; 24 struct net * fr_net;
25}; 25};