diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-16 04:02:20 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-20 08:02:06 (GMT) |
commit | 94b059520d6c0cea852dc9a3e9033c6f123df7c1 (patch) | |
tree | 591e57d7d41edf0469695a35c36cfeb4d2b265b3 /net/packet | |
parent | 7b6856a0296a8f187bb88ba31fa83a08abba7966 (diff) | |
download | linux-94b059520d6c0cea852dc9a3e9033c6f123df7c1.tar.xz |
af_packet: Avoid cache line dirtying
While doing multiple captures, I found af_packet was dirtying cache line
containing its prot_hook.
This slow down machines where several cpus are necessary to handle capture
traffic, as each prot_hook is traversed for each packet coming in or out
the host.
This patches moves "struct packet_type prot_hook" to the end of
packet_sock, and uses a ____cacheline_aligned_in_smp to make sure
this remains shared by all cpus.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index bf3a295..dac775e 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -188,7 +188,6 @@ struct packet_sock { struct packet_ring_buffer tx_ring; int copy_thresh; #endif - struct packet_type prot_hook; spinlock_t bind_lock; struct mutex pg_vec_lock; unsigned int running:1, /* prot_hook is attached*/ @@ -204,6 +203,7 @@ struct packet_sock { unsigned int tp_reserve; unsigned int tp_loss:1; #endif + struct packet_type prot_hook ____cacheline_aligned_in_smp; }; struct packet_skb_cb { |