Commit 0578edc5 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

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: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 660f7d22
...@@ -54,6 +54,7 @@ struct pgv { ...@@ -54,6 +54,7 @@ struct pgv {
struct packet_ring_buffer { struct packet_ring_buffer {
struct pgv *pg_vec; struct pgv *pg_vec;
unsigned int head; unsigned int head;
unsigned int frames_per_block; unsigned int frames_per_block;
unsigned int frame_size; unsigned int frame_size;
...@@ -63,8 +64,9 @@ struct packet_ring_buffer { ...@@ -63,8 +64,9 @@ struct packet_ring_buffer {
unsigned int pg_vec_pages; unsigned int pg_vec_pages;
unsigned int pg_vec_len; unsigned int pg_vec_len;
struct tpacket_kbdq_core prb_bdqc;
atomic_t pending; atomic_t pending;
struct tpacket_kbdq_core prb_bdqc;
}; };
extern struct mutex fanout_mutex; extern struct mutex fanout_mutex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment