]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/ipv4/tcp.c
[TCP]: Allow autoloading of congestion control via setsockopt.
[mv-sheeva.git] / net / ipv4 / tcp.c
index 66e9a729f6dfa87060c535d087fba0987bb44116..c05e8edaf5443645209d3515c7e328989c44ae47 100644 (file)
@@ -2270,7 +2270,7 @@ void __init tcp_init(void)
                                        thash_entries,
                                        (num_physpages >= 128 * 1024) ?
                                        13 : 15,
-                                       HASH_HIGHMEM,
+                                       0,
                                        &tcp_hashinfo.ehash_size,
                                        NULL,
                                        0);
@@ -2286,7 +2286,7 @@ void __init tcp_init(void)
                                        tcp_hashinfo.ehash_size,
                                        (num_physpages >= 128 * 1024) ?
                                        13 : 15,
-                                       HASH_HIGHMEM,
+                                       0,
                                        &tcp_hashinfo.bhash_size,
                                        NULL,
                                        64 * 1024);
@@ -2316,9 +2316,10 @@ void __init tcp_init(void)
                sysctl_max_syn_backlog = 128;
        }
 
-       sysctl_tcp_mem[0] =  768 << order;
-       sysctl_tcp_mem[1] = 1024 << order;
-       sysctl_tcp_mem[2] = 1536 << order;
+       /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */
+       sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order;
+       sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3;
+       sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2;
 
        limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
        max_share = min(4UL*1024*1024, limit);