Commit a78fd404 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix network hashtable sizing

The new networking hashtable sizing is all bollixed up.  The logic is wrong
and tcp is setting it to the logarithm of what was intended.  Heaven knows.

Fix it up so that the sizing is the same as it used to be in 2.6, with a
boot-time override.  Which was what was intended.
parent fb6c1a0c
......@@ -2753,9 +2753,7 @@ int __init ip_rt_init(void)
panic("IP: failed to allocate ip_dst_cache\n");
goal = num_physpages >> (26 - PAGE_SHIFT);
if (!rhash_entries)
goal = min(10, goal);
else
if (rhash_entries)
goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
/* NOTHING */;
......
......@@ -2621,9 +2621,7 @@ void __init tcp_init(void)
else
goal = num_physpages >> (23 - PAGE_SHIFT);
if (!thash_entries)
goal = min(10UL, goal);
else
if (thash_entries)
goal = (thash_entries * sizeof(struct tcp_ehash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment