blob: c59a2ae11dc436183635202289b47f2265055c3c [file] [log] [blame]
From stable-bounces@linux.kernel.org Wed Aug 9 02:35:56 2006
Date: Wed, 09 Aug 2006 02:35:21 -0700 (PDT)
Message-Id: <20060809.023521.21927097.davem@davemloft.net>
To: stable@kernel.org
From: David Miller <davem@davemloft.net>
Subject: Kill HASH_HIGHMEM from route cache hash sizing
From: Kirill Korotaev <dev@sw.ru>
[IPV4]: Limit rt cache size properly.
During OpenVZ stress testing we found that UDP traffic with random src
can generate too much excessive rt hash growing leading finally to OOM
and kernel panics.
It was found that for 4GB i686 system (having 1048576 total pages and
225280 normal zone pages) kernel allocates the following route hash:
syslog: IP route cache hash table entries: 262144 (order: 8, 1048576
bytes) => ip_rt_max_size = 4194304 entries, i.e. max rt size is
4194304 * 256b = 1Gb of RAM > normal_zone
Attached the patch which removes HASH_HIGHMEM flag from
alloc_large_system_hash() call.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/ipv4/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.17.8.orig/net/ipv4/route.c
+++ linux-2.6.17.8/net/ipv4/route.c
@@ -3144,7 +3144,7 @@ int __init ip_rt_init(void)
rhash_entries,
(num_physpages >= 128 * 1024) ?
15 : 17,
- HASH_HIGHMEM,
+ 0,
&rt_hash_log,
&rt_hash_mask,
0);