Arnaldo Carvalho de Melo
46ca5f5dc4
[XFRM]: Pack struct xfrm_policy
[acme@newtoy net-2.6.20]$ pahole net/ipv4/tcp.o xfrm_policy
/* /pub/scm/linux/kernel/git/acme/net-2.6.20/include/linux/security.h:67 */
struct xfrm_policy {
struct xfrm_policy * next; /* 0 4 */
struct hlist_node bydst; /* 4 8 */
struct hlist_node byidx; /* 12 8 */
rwlock_t lock; /* 20 36 */
atomic_t refcnt; /* 56 4 */
struct timer_list timer; /* 60 24 */
u8 type; /* 84 1 */
/* XXX 3 bytes hole, try to pack */
u32 priority; /* 88 4 */
u32 index; /* 92 4 */
struct xfrm_selector selector; /* 96 56 */
struct xfrm_lifetime_cfg lft; /* 152 64 */
struct xfrm_lifetime_cur curlft; /* 216 32 */
struct dst_entry * bundles; /* 248 4 */
__u16 family; /* 252 2 */
__u8 action; /* 254 1 */
__u8 flags; /* 255 1 */
__u8 dead; /* 256 1 */
__u8 xfrm_nr; /* 257 1 */
/* XXX 2 bytes hole, try to pack */
struct xfrm_sec_ctx * security; /* 260 4 */
struct xfrm_tmpl xfrm_vec[6]; /* 264 360 */
}; /* size: 624, sum members: 619, holes: 2, sum holes: 5 */
So lets have just one hole instead of two, by moving 'type' to just before 'action',
end result:
[acme@newtoy net-2.6.20]$ codiff -s /tmp/tcp.o.before net/ipv4/tcp.o
/pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv4/tcp.c:
struct xfrm_policy | -4
1 struct changed
[acme@newtoy net-2.6.20]$
[acme@newtoy net-2.6.20]$ pahole -c 64 net/ipv4/tcp.o xfrm_policy
/* /pub/scm/linux/kernel/git/acme/net-2.6.20/include/linux/security.h:67 */
struct xfrm_policy {
struct xfrm_policy * next; /* 0 4 */
struct hlist_node bydst; /* 4 8 */
struct hlist_node byidx; /* 12 8 */
rwlock_t lock; /* 20 36 */
atomic_t refcnt; /* 56 4 */
struct timer_list timer; /* 60 24 */
u32 priority; /* 84 4 */
u32 index; /* 88 4 */
struct xfrm_selector selector; /* 92 56 */
struct xfrm_lifetime_cfg lft; /* 148 64 */
struct xfrm_lifetime_cur curlft; /* 212 32 */
struct dst_entry * bundles; /* 244 4 */
u16 family; /* 248 2 */
u8 type; /* 250 1 */
u8 action; /* 251 1 */
u8 flags; /* 252 1 */
u8 dead; /* 253 1 */
u8 xfrm_nr; /* 254 1 */
/* XXX 1 byte hole, try to pack */
struct xfrm_sec_ctx * security; /* 256 4 */
struct xfrm_tmpl xfrm_vec[6]; /* 260 360 */
}; /* size: 620, sum members: 619, holes: 1, sum holes: 1 */
Are there any fugly data dependencies here? None that I know.
In the process changed the removed the __ prefixed types, that are just for
userspace visible headers.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-12-02 21:30:48 -08:00
..
2006-12-02 21:21:29 -08:00
2006-12-02 21:22:48 -08:00
2006-12-02 21:27:14 -08:00
2006-09-22 14:55:10 -07:00
2006-12-02 21:21:08 -08:00
2006-09-22 14:55:10 -07:00
2006-12-02 21:22:52 -08:00
2006-08-02 14:12:06 -07:00
2006-09-21 11:46:18 +10:00
2006-12-02 21:22:50 -08:00
2006-12-02 21:22:55 -08:00
2006-12-02 21:23:39 -08:00
2006-12-02 21:24:12 -08:00
2006-09-22 14:54:40 -07:00
2006-10-21 20:24:01 -07:00
2006-12-02 21:23:40 -08:00
2006-09-28 18:02:58 -07:00
2006-09-22 15:17:35 -07:00
2006-12-02 21:22:11 -08:00
2006-12-02 21:21:39 -08:00
2006-12-02 21:22:42 -08:00
2006-09-28 18:01:06 -07:00
2006-12-02 00:11:57 -05:00
2006-10-16 20:09:47 -04:00
2006-12-02 21:22:08 -08:00
2006-12-02 21:21:52 -08:00
2006-12-02 21:21:10 -08:00
2006-12-02 21:30:46 -08:00
2006-12-02 21:23:40 -08:00
2006-09-28 18:02:26 -07:00
2006-09-28 18:02:26 -07:00
2006-10-12 00:00:00 -07:00
2006-10-20 00:28:35 -07:00
2006-12-02 21:23:25 -08:00
2006-12-02 21:22:07 -08:00
2006-12-02 21:22:52 -08:00
2006-12-02 21:21:40 -08:00
2006-12-02 21:21:39 -08:00
2006-12-02 21:23:41 -08:00
2006-12-02 21:23:40 -08:00
2006-09-21 11:46:22 +10:00
2006-12-02 21:21:09 -08:00
2006-12-02 21:26:15 -08:00
2006-12-02 21:22:53 -08:00
2006-11-05 14:11:25 -08:00
2006-12-02 21:21:23 -08:00
2006-09-22 15:07:01 -07:00
2006-12-02 21:22:52 -08:00
2006-09-22 15:20:24 -07:00
2006-10-04 03:38:54 -04:00
2006-08-02 13:38:20 -07:00
2006-12-02 21:24:07 -08:00
2006-12-02 21:30:30 -08:00
2006-09-22 14:55:04 -07:00
2006-07-24 12:44:23 -07:00
2006-12-02 21:21:12 -08:00
2006-12-02 21:21:12 -08:00
2006-08-04 22:59:51 -07:00
2006-12-02 21:22:39 -08:00
2006-09-28 18:02:10 -07:00
2006-12-02 21:27:19 -08:00
2006-08-02 14:12:06 -07:00
2006-09-22 14:55:16 -07:00
2006-12-02 21:23:51 -08:00
2006-12-02 21:27:16 -08:00
2006-12-02 21:22:39 -08:00
2006-12-02 21:22:46 -08:00
2006-12-02 21:30:45 -08:00
2006-12-02 21:27:16 -08:00
2006-12-02 21:30:48 -08:00