diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2007-02-09 19:26:55 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-11 02:20:45 -0500 |
commit | 1e19e02ca0c5e33ea73a25127dbe6c3b8fcaac4b (patch) | |
tree | 23afba2945a9e09b137b094a868ea176c1e1c800 /include/net/dst.h | |
parent | 0c195c3fc4e95a06b0c0017506f074c94af99c35 (diff) |
[NET]: Reorder fields of struct dst_entry
This last patch (but not least :) ) finally moves the next pointer at
the end of struct dst_entry. This permits to perform route cache
lookups with a minimal cost of one cache line per entry, instead of
two.
Both 32bits and 64bits platforms benefit from this new layout.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r-- | include/net/dst.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 5d62342e8bc4..e12a8ce0b9b3 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -37,14 +37,7 @@ struct sk_buff; | |||
37 | 37 | ||
38 | struct dst_entry | 38 | struct dst_entry |
39 | { | 39 | { |
40 | union { | 40 | struct rcu_head rcu_head; |
41 | struct dst_entry *next; | ||
42 | struct rtable *rt_next; | ||
43 | struct rt6_info *rt6_next; | ||
44 | struct dn_route *dn_next; | ||
45 | }; | ||
46 | atomic_t __refcnt; /* client references */ | ||
47 | int __use; | ||
48 | struct dst_entry *child; | 41 | struct dst_entry *child; |
49 | struct net_device *dev; | 42 | struct net_device *dev; |
50 | short error; | 43 | short error; |
@@ -55,7 +48,6 @@ struct dst_entry | |||
55 | #define DST_NOPOLICY 4 | 48 | #define DST_NOPOLICY 4 |
56 | #define DST_NOHASH 8 | 49 | #define DST_NOHASH 8 |
57 | #define DST_BALANCED 0x10 | 50 | #define DST_BALANCED 0x10 |
58 | unsigned long lastuse; | ||
59 | unsigned long expires; | 51 | unsigned long expires; |
60 | 52 | ||
61 | unsigned short header_len; /* more space at head required */ | 53 | unsigned short header_len; /* more space at head required */ |
@@ -80,8 +72,16 @@ struct dst_entry | |||
80 | #endif | 72 | #endif |
81 | 73 | ||
82 | struct dst_ops *ops; | 74 | struct dst_ops *ops; |
83 | struct rcu_head rcu_head; | ||
84 | 75 | ||
76 | unsigned long lastuse; | ||
77 | atomic_t __refcnt; /* client references */ | ||
78 | int __use; | ||
79 | union { | ||
80 | struct dst_entry *next; | ||
81 | struct rtable *rt_next; | ||
82 | struct rt6_info *rt6_next; | ||
83 | struct dn_route *dn_next; | ||
84 | }; | ||
85 | char info[0]; | 85 | char info[0]; |
86 | }; | 86 | }; |
87 | 87 | ||