]> git.baikalelectronics.ru Git - kernel.git/commit
af_packet: Avoid cache line dirtying
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 16 Oct 2009 04:02:20 +0000 (04:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Oct 2009 08:02:06 +0000 (01:02 -0700)
commitba9432f6d729dc5789602e501c5e5d2bc121dbb6
tree591e57d7d41edf0469695a35c36cfeb4d2b265b3
parent72d67014aaef5af42a0af2426faa46d91778ecbe
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>
net/packet/af_packet.c