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
..
2006-09-28 18:02:48 -07:00
2006-12-02 21:21:08 -08:00
2005-04-16 15:20:36 -07:00
2005-08-29 15:32:25 -07:00
2006-09-22 14:54:40 -07:00
2006-12-02 21:21:19 -08:00
2006-09-28 18:02:58 -07:00
2005-04-16 15:20:36 -07:00
2006-09-28 18:01:06 -07:00
2006-12-02 21:21:20 -08:00
2005-04-16 15:20:36 -07:00
2006-10-18 19:55:25 -07:00
2005-04-16 15:20:36 -07:00
2006-09-28 18:02:09 -07:00
2005-04-16 15:20:36 -07:00
2006-12-02 21:21:21 -08:00
2006-11-05 14:11:25 -08:00
2006-03-23 07:12:57 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-12-02 21:21:23 -08:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-09-22 07:57:21 -03:00
2006-03-20 22:59:36 -08:00
2006-10-15 11:00:58 -07:00
2005-08-29 16:01:32 -07:00
2005-08-29 15:32:25 -07:00
2006-09-28 18:02:10 -07:00
2006-06-30 14:12:10 -07:00
2006-12-02 21:21:36 -08:00