aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-10-11 08:20:54 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-11 19:09:14 -0400
commite37ef961e50d74f55e9edb48e54dd2e7963aad39 (patch)
treeac069f1c0fa4eaf54b28d712d05f7e483d165b19 /include/net/neighbour.h
parentfc66f95c68b6d4535a0ea2ea15d5cf626e310956 (diff)
neigh: reorder struct neighbour fields
Le mardi 12 octobre 2010 à 00:02 +0200, Eric Dumazet a écrit : > Here is the followup patch. > > Thanks ! > Oops, this was an old version, the up2date ones also took care of "used" field. I guess its time for a sleep, sorry again. [PATCH net-next V2] neigh: reorder struct neighbour fields (refcnt) and (ha_lock, ha, used, dev, output, ops, primary_key) should be placed on a separate cache lines. refcnt can be often written, while other fields are mostly read. This gave me good result on stress test : before: real 0m45.570s user 0m15.525s sys 9m56.669s After: real 0m41.841s user 0m15.261s sys 8m45.949s Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index f04e7a2522c5..55590ab16b3e 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -94,8 +94,6 @@ struct neighbour {
94 struct neighbour __rcu *next; 94 struct neighbour __rcu *next;
95 struct neigh_table *tbl; 95 struct neigh_table *tbl;
96 struct neigh_parms *parms; 96 struct neigh_parms *parms;
97 struct net_device *dev;
98 unsigned long used;
99 unsigned long confirmed; 97 unsigned long confirmed;
100 unsigned long updated; 98 unsigned long updated;
101 __u8 flags; 99 __u8 flags;
@@ -103,16 +101,18 @@ struct neighbour {
103 __u8 type; 101 __u8 type;
104 __u8 dead; 102 __u8 dead;
105 atomic_t refcnt; 103 atomic_t refcnt;
104 struct sk_buff_head arp_queue;
105 struct timer_list timer;
106 unsigned long used;
106 atomic_t probes; 107 atomic_t probes;
107 rwlock_t lock; 108 rwlock_t lock;
108 seqlock_t ha_lock; 109 seqlock_t ha_lock;
109 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; 110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
110 struct hh_cache *hh; 111 struct hh_cache *hh;
111 int (*output)(struct sk_buff *skb); 112 int (*output)(struct sk_buff *skb);
112 struct sk_buff_head arp_queue;
113 struct timer_list timer;
114 const struct neigh_ops *ops; 113 const struct neigh_ops *ops;
115 struct rcu_head rcu; 114 struct rcu_head rcu;
115 struct net_device *dev;
116 u8 primary_key[0]; 116 u8 primary_key[0];
117}; 117};
118 118