summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh.dickins@tiscali.co.uk>2009-06-17 00:31:50 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 04:47:31 +0200
commit6c0db4664b49417d80988953e69c323721353227 (patch)
tree83ec1fcf3607b06c8c3cc2d39b5d10a61289cdd6 /mm/page_alloc.c
parentcpuset,mm: update tasks' mems_allowed in time (diff)
downloadlinux-6c0db4664b49417d80988953e69c323721353227.tar.xz
linux-6c0db4664b49417d80988953e69c323721353227.zip
mm: alloc_large_system_hash check order
On an x86_64 with 4GB ram, tcp_init()'s call to alloc_large_system_hash(), to allocate tcp_hashinfo.ehash, is now triggering an mmotm WARN_ON_ONCE on order >= MAX_ORDER - it's hoping for order 11. alloc_large_system_hash() had better make its own check on the order. Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: David Miller <davem@davemloft.net> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Eric Dumazet <dada1@cosmosbay.com> Cc: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/page_alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7cc3179e3591..cbed869fd831 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4511,7 +4511,10 @@ void *__init alloc_large_system_hash(const char *tablename,
table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
else {
unsigned long order = get_order(size);
- table = (void*) __get_free_pages(GFP_ATOMIC, order);
+
+ if (order < MAX_ORDER)
+ table = (void *)__get_free_pages(GFP_ATOMIC,
+ order);
/*
* If bucketsize is not a power-of-two, we may free
* some pages at the end of hash table.