diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-04-19 02:12:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-25 01:29:43 -0400 |
commit | 0578edc5604e3e192980f406f9e1040aa6434ca4 (patch) | |
tree | 20d3f3cf7a9666235c20d541b3a3c4b938995200 /net/packet | |
parent | 660f7d22298ceb82facd2088c197f2de5cbfb7d6 (diff) |
packet: reorder a member in packet_ring_buffer
There's a 4 byte hole in packet_ring_buffer structure before
prb_bdqc, that can be filled with 'pending' member, thus we can
reduce the overall structure size from 224 bytes to 216 bytes.
This also has the side-effect, that in struct packet_sock 2*4 byte
holes after the embedded packet_ring_buffer members are removed,
and overall, packet_sock can be reduced by 1 cacheline:
Before: size: 1344, cachelines: 21, members: 24
After: size: 1280, cachelines: 20, members: 24
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h index e891f025a1b9..650751b9a7ee 100644 --- a/net/packet/internal.h +++ b/net/packet/internal.h | |||
@@ -54,6 +54,7 @@ struct pgv { | |||
54 | 54 | ||
55 | struct packet_ring_buffer { | 55 | struct packet_ring_buffer { |
56 | struct pgv *pg_vec; | 56 | struct pgv *pg_vec; |
57 | |||
57 | unsigned int head; | 58 | unsigned int head; |
58 | unsigned int frames_per_block; | 59 | unsigned int frames_per_block; |
59 | unsigned int frame_size; | 60 | unsigned int frame_size; |
@@ -63,8 +64,9 @@ struct packet_ring_buffer { | |||
63 | unsigned int pg_vec_pages; | 64 | unsigned int pg_vec_pages; |
64 | unsigned int pg_vec_len; | 65 | unsigned int pg_vec_len; |
65 | 66 | ||
66 | struct tpacket_kbdq_core prb_bdqc; | ||
67 | atomic_t pending; | 67 | atomic_t pending; |
68 | |||
69 | struct tpacket_kbdq_core prb_bdqc; | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | extern struct mutex fanout_mutex; | 72 | extern struct mutex fanout_mutex; |