summaryrefslogtreecommitdiffstats
path: root/net/ipv4/protocol.c
diff options
context:
space:
mode:
authorEric Dumazet2007-03-27 23:18:34 +0200
committerDavid S. Miller2007-04-26 07:28:20 +0200
commit03d4f879b9ddf7d5c1f788792247e62450342eed (patch)
treeae5598e3309da4a6725f60ce7facf968849a7ab8 /net/ipv4/protocol.c
parent[TCP]: tcp_memory_pressure and tcp_socket are__read_mostly candidates (diff)
downloadkernel-qcow2-linux-03d4f879b9ddf7d5c1f788792247e62450342eed.tar.gz
kernel-qcow2-linux-03d4f879b9ddf7d5c1f788792247e62450342eed.tar.xz
kernel-qcow2-linux-03d4f879b9ddf7d5c1f788792247e62450342eed.zip
[IPV4]: align inet_protos[] on SMP
As IPPROTO_TCP is 6, it makes sense to make sure inet_protos[] array is properly cache line aligned to avoid false sharing on SMP. c0680540 b peer_total c0680544 b inet_peer_unused_head c0680560 B inet_protos On i386 this example, we can see that inet_protos[IPPROTO_TCP] shares a potentially hot (and modified) cache line. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/protocol.c')
-rw-r--r--net/ipv4/protocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index da70fef82c93..971ab9356e51 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -45,7 +45,7 @@
#include <net/ipip.h>
#include <linux/igmp.h>
-struct net_protocol *inet_protos[MAX_INET_PROTOS];
+struct net_protocol *inet_protos[MAX_INET_PROTOS] ____cacheline_aligned_in_smp;
static DEFINE_SPINLOCK(inet_proto_lock);
/*