kernel-ark/net/ipv6
Eric Dumazet 286ab3d460 [NET]: Define infrastructure to keep 'inuse' changes in an efficent SMP/NUMA way.
"struct proto" currently uses an array stats[NR_CPUS] to track change on
'inuse' sockets per protocol.

If NR_CPUS is big, this means we use a big memory area for this.
Moreover, all this memory area is located on a single node on NUMA
machines, increasing memory pressure on the boot node.

In this patch, I tried to :

- Keep a fast !CONFIG_SMP implementation
- Keep a fast CONFIG_SMP implementation for often used protocols
(tcp,udp,raw,...)
- Introduce a NUMA efficient implementation

Some helper macros are defined in include/net/sock.h
These macros take into account CONFIG_SMP

If a "struct proto" is declared without using DEFINE_PROTO_INUSE /
REF_PROTO_INUSE
macros, it will automatically use a default implementation, using a
dynamically allocated percpu zone.
This default implementation will be NUMA efficient, but might use 32/64
bytes per possible cpu
because of current alloc_percpu() implementation.
However it still should be better than previous implementation based on
stats[NR_CPUS] field.

When a "struct proto" is changed to use the new macros, we use a single
static "int" percpu variable,
lowering the memory and cpu costs, still preserving NUMA efficiency.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-07 04:08:57 -08:00
..
netfilter [NETFILTER]: Clean up Makefile 2007-11-07 04:08:22 -08:00
addrconf_core.c
addrconf.c [IPV6]: remove duplicate call to proc_net_remove 2007-10-30 21:16:24 -07:00
af_inet6.c [NET]: Forget the zero_it argument of sk_alloc() 2007-11-01 00:39:31 -07:00
ah6.c cleanup asm/scatterlist.h includes 2007-11-02 08:47:06 +01:00
anycast.c [NET]: Make core networking code use seq_open_private 2007-10-10 16:55:33 -07:00
datagram.c [NET]: Make the device list and device lookups per namespace. 2007-10-10 16:49:10 -07:00
esp6.c [NET]: Fix incorrect sg_mark_end() calls. 2007-10-30 21:29:29 -07:00
exthdrs_core.c
exthdrs.c [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
fib6_rules.c [IPV4/IPV6/DECNET]: Small cleanup for fib rules. 2007-10-10 16:51:22 -07:00
icmp.c [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
inet6_connection_sock.c [IPV6] __inet6_csk_dst_store(): fix check-after-use 2007-10-15 12:26:32 -07:00
inet6_hashtables.c [INET]: Justification for local port range robustness. 2007-10-18 22:00:17 -07:00
ip6_fib.c [IPv6]: use container_of() macro in fib6_clean_node() 2007-10-10 16:54:58 -07:00
ip6_flowlabel.c [IPV6]: Fix again the fl6_sock_lookup() fixed locking 2007-10-18 05:38:48 -07:00
ip6_input.c [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
ip6_output.c [IPV6]: Consolidate the ip cork destruction in ip6_output.c 2007-11-07 04:08:26 -08:00
ip6_tunnel.c [NET]: Treat the sign of the result of skb_headroom() consistently 2007-10-23 21:27:55 -07:00
ipcomp6.c cleanup asm/scatterlist.h includes 2007-11-02 08:47:06 +01:00
ipv6_sockglue.c [IPv6]: Update setsockopt(IPV6_MULTICAST_IF) to support RFC 3493, try2 2007-10-11 14:39:29 -07:00
Kconfig
Makefile
mcast.c [NET]: Make core networking code use seq_open_private 2007-10-10 16:55:33 -07:00
mip6.c [IPSEC]: Move IP length/checksum setting out of transforms 2007-10-10 16:55:56 -07:00
ndisc.c [IPV6] NDISC: Fix setting base_reachable_time_ms variable. 2007-10-29 22:37:22 -07:00
netfilter.c [NETFILTER]: Replace sk_buff ** with sk_buff * 2007-10-15 12:26:29 -07:00
proc.c [NET]: Define infrastructure to keep 'inuse' changes in an efficent SMP/NUMA way. 2007-11-07 04:08:57 -08:00
protocol.c
raw.c [NET]: Make core networking code use seq_open_private 2007-10-10 16:55:33 -07:00
reassembly.c [INET]: Consolidate frag queues freeing 2007-10-17 19:48:26 -07:00
route.c sysctl: ipv6 route flushing (kill binary path) 2007-10-18 14:37:22 -07:00
sit.c [NET]: Treat the sign of the result of skb_headroom() consistently 2007-10-23 21:27:55 -07:00
sysctl_net_ipv6.c [INET]: Collect common frag sysctl variables together 2007-10-15 12:26:40 -07:00
tcp_ipv6.c [SG] Get rid of __sg_mark_end() 2007-11-02 08:47:06 +01:00
tunnel6.c [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
udp_impl.h [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
udp.c [IPv6] SNMP: Restore Udp6InErrors incrementation 2007-11-07 04:08:54 -08:00
udplite.c [IPV6]: Replace sk_buff ** with sk_buff * in input handlers 2007-10-15 12:50:28 -07:00
xfrm6_input.c [IPSEC]: Rename mode to outer_mode and add inner_mode 2007-10-17 21:35:51 -07:00
xfrm6_mode_beet.c [IPSEC]: Add missing BEET checks 2007-10-17 21:31:50 -07:00
xfrm6_mode_ro.c [IPSEC]: Disallow combinations of RO and AH/ESP/IPCOMP 2007-10-17 21:35:15 -07:00
xfrm6_mode_transport.c [IPSEC]: Use IPv6 calling convention as the convention for x->mode->output 2007-10-10 16:55:54 -07:00
xfrm6_mode_tunnel.c [IPSEC]: Add missing BEET checks 2007-10-17 21:31:50 -07:00
xfrm6_output.c [IPSEC]: Rename mode to outer_mode and add inner_mode 2007-10-17 21:35:51 -07:00
xfrm6_policy.c [IPSEC]: Rename mode to outer_mode and add inner_mode 2007-10-17 21:35:51 -07:00
xfrm6_state.c [IPSEC]: Store afinfo pointer in xfrm_mode 2007-10-17 21:33:12 -07:00
xfrm6_tunnel.c [IPSEC]: Get nexthdr from caller in xfrm6_rcv_spi 2007-10-17 21:29:25 -07:00