From: Eric Dumazet Date: Tue, 27 Mar 2007 21:18:34 +0000 (-0700) Subject: [IPV4]: align inet_protos[] on SMP X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03d4f879b9ddf7d5c1f788792247e62450342eed;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: David S. Miller --- 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 #include -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); /*