]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
netns: reorder fields in struct net
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 14 Oct 2010 05:56:18 +0000 (05:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Oct 2010 20:49:14 +0000 (13:49 -0700)
In a network bench, I noticed an unfortunate false sharing between
'loopback_dev' and 'count' fields in "struct net".

'count' is written each time a socket is created or destroyed, while
loopback_dev might be often read in routing code.

Move loopback_dev in a read mostly section of "struct net"

Note: struct netns_xfrm is cache line aligned on SMP.
(It contains a "struct dst_ops")
Move it at the end to avoid holes, and reduce sizeof(struct net) by 128
bytes on ia32.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found