linux/net/ipv4
Eric Dumazet 72a3effaf6 [NET]: Size listen hash tables using backlog hint
We currently allocate a fixed size (TCP_SYNQ_HSIZE=512) slots hash table for
each LISTEN socket, regardless of various parameters (listen backlog for
example)

On x86_64, this means order-1 allocations (might fail), even for 'small'
sockets, expecting few connections. On the contrary, a huge server wanting a
backlog of 50000 is slowed down a bit because of this fixed limit.

This patch makes the sizing of listen hash table a dynamic parameter,
depending of :
- net.core.somaxconn tunable (default is 128)
- net.ipv4.tcp_max_syn_backlog tunable (default : 256, 1024 or 128)
- backlog value given by user application  (2nd parameter of listen())

For large allocations (bigger than PAGE_SIZE), we use vmalloc() instead of
kmalloc().

We still limit memory allocation with the two existing tunables (somaxconn &
tcp_max_syn_backlog). So for standard setups, this patch actually reduce RAM
usage.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-02 21:21:44 -08:00
..
ipvs [NET]: Turn nfmark into generic mark 2006-12-02 21:21:38 -08:00
netfilter [NET]: Rethink mark field in struct flowi 2006-12-02 21:21:39 -08:00
af_inet.c [NET]: Size listen hash tables using backlog hint 2006-12-02 21:21:44 -08:00
ah4.c [IPV4]: encapsulation annotations 2006-12-02 21:21:17 -08:00
arp.c fix file specification in comments 2006-10-03 23:01:26 +02:00
cipso_ipv4.c [NetLabel]: protect the CIPSOv4 socket option from setsockopt() 2006-10-30 15:24:49 -08:00
datagram.c
devinet.c
esp4.c [IPV4]: encapsulation annotations 2006-12-02 21:21:17 -08:00
fib_frontend.c [IPV4] nl_fib_lookup: Rename fl_fwmark to fl_mark 2006-12-02 21:21:40 -08:00
fib_hash.c
fib_lookup.h
fib_rules.c [NET] rules: Share common attribute validation policy 2006-12-02 21:21:41 -08:00
fib_semantics.c
fib_trie.c
icmp.c
igmp.c
inet_connection_sock.c [NET]: Size listen hash tables using backlog hint 2006-12-02 21:21:44 -08:00
inet_diag.c
inet_hashtables.c
inet_timewait_sock.c
inetpeer.c [NET]: reduce sizeof(struct inet_peer), cleanup, change in peer_check_expire() 2006-10-15 23:14:17 -07:00
ip_forward.c
ip_fragment.c
ip_gre.c [IPV4]: encapsulation annotations 2006-12-02 21:21:17 -08:00
ip_input.c
ip_options.c [NetLabel]: protect the CIPSOv4 socket option from setsockopt() 2006-10-30 15:24:49 -08:00
ip_output.c [NET]: Turn nfmark into generic mark 2006-12-02 21:21:38 -08:00
ip_sockglue.c
ipcomp.c [XFRM]: BEET mode 2006-10-04 00:31:09 -07:00
ipconfig.c [NET]: ipconfig and nfsroot annotations 2006-12-02 21:21:09 -08:00
ipip.c [IPV4]: encapsulation annotations 2006-12-02 21:21:17 -08:00
ipmr.c
Kconfig [NET]: Rethink mark field in struct flowi 2006-12-02 21:21:39 -08:00
Makefile [XFRM]: BEET mode 2006-10-04 00:31:09 -07:00
multipath_drr.c
multipath_random.c
multipath_rr.c
multipath_wrandom.c
multipath.c
netfilter.c [NET]: Rethink mark field in struct flowi 2006-12-02 21:21:39 -08:00
proc.c
protocol.c
raw.c [NET]: fix uaccess handling 2006-10-30 15:24:41 -08:00
route.c [NET]: Rethink mark field in struct flowi 2006-12-02 21:21:39 -08:00
syncookies.c
sysctl_net_ipv4.c [TCP]: Set default congestion control when no sysctl. 2006-11-01 15:42:34 -08:00
tcp_bic.c
tcp_cong.c [TCP]: Set default congestion control when no sysctl. 2006-11-01 15:42:34 -08:00
tcp_cubic.c [TCP] cubic: scaling error 2006-10-25 23:04:12 -07:00
tcp_diag.c
tcp_highspeed.c
tcp_htcp.c [TCP] H-TCP: fix integer overflow 2006-10-25 23:05:52 -07:00
tcp_hybla.c
tcp_input.c SELinux: Return correct context for SO_PEERSEC 2006-12-02 21:21:33 -08:00
tcp_ipv4.c [NET]: Size listen hash tables using backlog hint 2006-12-02 21:21:44 -08:00
tcp_lp.c [TCP] tcp-lp: prevent chance for oops 2006-09-28 18:03:07 -07:00
tcp_minisocks.c
tcp_output.c [TCP]: Bound TSO defer time 2006-10-18 20:36:48 -07:00
tcp_probe.c [NET]: Fix kfifo_alloc() error check. 2006-11-25 15:16:49 -08:00
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_veno.c
tcp_westwood.c
tcp.c [TCP]: Fix up sysctl_tcp_mem initialization. 2006-11-15 21:18:51 -08:00
tunnel4.c
udp.c [UDP]: Make udp_encap_rcv use pskb_may_pull 2006-11-25 15:16:48 -08:00
xfrm4_input.c [XFRM]: xfrm_parse_spi() annotations 2006-09-28 18:02:39 -07:00
xfrm4_mode_beet.c [XFRM]: BEET mode 2006-10-04 00:31:09 -07:00
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c [XFRM]: misc annotations 2006-12-02 21:21:11 -08:00
xfrm4_state.c
xfrm4_tunnel.c