diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-01-22 09:18:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:41 -0500 |
commit | 69a73829dbb10e7c8554e66a80cb4fde57347fff (patch) | |
tree | 032f67850cd73fc71b573f2a155a5037bde53f71 /include | |
parent | 81566e8322c3f6c6f9a2277fe0e440fee8d917bd (diff) |
[DST]: shrinks sizeof(struct rtable) by 64 bytes on x86_64
On x86_64, sizeof(struct rtable) is 0x148, which is rounded up to
0x180 bytes by SLAB allocator.
We can reduce this to exactly 0x140 bytes, without alignment overhead,
and store 12 struct rtable per PAGE instead of 10.
rate_tokens is currently defined as an "unsigned long", while its
content should not exceed 6*HZ. It can safely be converted to an
unsigned int.
Moving tclassid right after rate_tokens to fill the 4 bytes hole
permits to save 8 bytes on 'struct dst_entry', which finally permits
to save 8 bytes on 'struct rtable'
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/dst.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index c45dcc31b3bb..e3ac7d0fc4e1 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -56,7 +56,11 @@ struct dst_entry | |||
56 | struct dst_entry *path; | 56 | struct dst_entry *path; |
57 | 57 | ||
58 | unsigned long rate_last; /* rate limiting for ICMP */ | 58 | unsigned long rate_last; /* rate limiting for ICMP */ |
59 | unsigned long rate_tokens; | 59 | unsigned int rate_tokens; |
60 | |||
61 | #ifdef CONFIG_NET_CLS_ROUTE | ||
62 | __u32 tclassid; | ||
63 | #endif | ||
60 | 64 | ||
61 | struct neighbour *neighbour; | 65 | struct neighbour *neighbour; |
62 | struct hh_cache *hh; | 66 | struct hh_cache *hh; |
@@ -65,10 +69,6 @@ struct dst_entry | |||
65 | int (*input)(struct sk_buff*); | 69 | int (*input)(struct sk_buff*); |
66 | int (*output)(struct sk_buff*); | 70 | int (*output)(struct sk_buff*); |
67 | 71 | ||
68 | #ifdef CONFIG_NET_CLS_ROUTE | ||
69 | __u32 tclassid; | ||
70 | #endif | ||
71 | |||
72 | struct dst_ops *ops; | 72 | struct dst_ops *ops; |
73 | 73 | ||
74 | unsigned long lastuse; | 74 | unsigned long lastuse; |