From: Robin Holt <holt@oss.sgi.com>
To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Limit the route hash size.
Date: Thu, 9 Dec 2004 08:25:37 -0800 [thread overview]
Message-ID: <20041209082537.A1262@oss.sgi.com> (raw)
I got the following from the boot of one of our really large machines:
IP: routing cache hash table of 33554432 buckets, 524288Kbytes
I have done a lot of testing with the rt_hash_table. I would like to
propose that for the overwhelming majority of machines, the default size
is wrong.
It is currently based on numphyspages(). I would suggest that the
majority of machines will never need more than a single page of memory
for this hash. In my testing, I found a single 16k page would only get an
11% fill in a fairly heavily used production machine on a large network.
The only place where the large route cache seems to make sense is for
larger servers that are servicing internet connections from many sites.
Since the cache is completely flushed every 10 minutes by default, the
above machine would have to be adding 55,924 routes per second that were
ideally distrbuted throughout the hash space to even fill every bucket.
The patch I am proposing is as follows. For the sites that need larger
route hashes, they can use the rhash_entries command line option to set
it as desired.
Signed-off-by: Robin Holt <holt@sgi.com>
diff -Naur linux-orig/net/ipv4/route.c linux/net/ipv4/route.c
--- linux-orig/net/ipv4/route.c 2004-12-09 09:00:06 -06:00
+++ linux/net/ipv4/route.c 2004-12-09 08:56:33 -06:00
@@ -2728,7 +2728,7 @@
if (!ipv4_dst_ops.kmem_cachep)
panic("IP: failed to allocate ip_dst_cache\n");
- goal = num_physpages >> (26 - PAGE_SHIFT);
+ goal = 0;
if (rhash_entries)
goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
reply other threads:[~2004-12-09 16:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041209082537.A1262@oss.sgi.com \
--to=holt@oss.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).