[SOCK][NETNS]: Add the percpu prot_inuse counter in the struct net.
authorPavel Emelyanov <xemul@openvz.org>
Tue, 1 Apr 2008 02:42:16 +0000 (19:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Apr 2008 02:42:16 +0000 (19:42 -0700)
commit70ee115942be6ce52ff10e5e813fb4da82cdb25a
treeaa3a22dfece765ead70df8f07974e398766b0104
parentc29a0bc4dfc4d833eb702b1929cec96a3eeb9f7a
[SOCK][NETNS]: Add the percpu prot_inuse counter in the struct net.

Such an accounting would cost us two more dereferences to get the
percpu variable from the struct net, so I make sock_prot_inuse_get
and _add calls work differently depending on CONFIG_NET_NS - without
it old optimized routines are used.

The per-cpu counter for init_net is prepared in core_initcall, so
that even af_inet, that starts as fs_initcall, will already have the
init_net prepared.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netns/core.h
net/core/sock.c