mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
tcp: change default tcp hash size
As time passed, available memory increased faster than number of concurrent tcp sockets. As a result, a machine with 4GB of ram gets a hash table with 524288 slots, using 8388608 bytes of memory. Lets change that by a 16x factor (one slot for 128 KB of ram) Even if a small machine needs a _lot_ of sockets, tcp lookups are now very efficient, using one cache line per socket. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
abe303dbc2
commit
fd90b29d75
1 changed files with 2 additions and 4 deletions
|
@ -3590,8 +3590,7 @@ void __init tcp_init(void)
|
|||
alloc_large_system_hash("TCP established",
|
||||
sizeof(struct inet_ehash_bucket),
|
||||
thash_entries,
|
||||
(totalram_pages >= 128 * 1024) ?
|
||||
13 : 15,
|
||||
17, /* one slot per 128 KB of memory */
|
||||
0,
|
||||
NULL,
|
||||
&tcp_hashinfo.ehash_mask,
|
||||
|
@ -3607,8 +3606,7 @@ void __init tcp_init(void)
|
|||
alloc_large_system_hash("TCP bind",
|
||||
sizeof(struct inet_bind_hashbucket),
|
||||
tcp_hashinfo.ehash_mask + 1,
|
||||
(totalram_pages >= 128 * 1024) ?
|
||||
13 : 15,
|
||||
17, /* one slot per 128 KB of memory */
|
||||
0,
|
||||
&tcp_hashinfo.bhash_size,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue