From 70ee115942be6ce52ff10e5e813fb4da82cdb25a Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 31 Mar 2008 19:42:16 -0700 Subject: [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 Signed-off-by: David S. Miller --- include/net/netns/core.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/net/netns') diff --git a/include/net/netns/core.h b/include/net/netns/core.h index 0e8c0f8435d..24d4be76bbd 100644 --- a/include/net/netns/core.h +++ b/include/net/netns/core.h @@ -2,12 +2,15 @@ #define __NETNS_CORE_H__ struct ctl_table_header; +struct prot_inuse; struct netns_core { /* core sysctls */ struct ctl_table_header *sysctl_hdr; int sysctl_somaxconn; + + struct prot_inuse *inuse; }; #endif -- cgit v1.2.3