linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mmotm] mm: alloc_large_system_hash check order
@ 2009-04-29 21:09 Hugh Dickins
  2009-04-29 21:28 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Hugh Dickins @ 2009-04-29 21:09 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Andi Kleen, David Miller, netdev, linux-kernel,
	linux-mm

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@veritas.com>
---
Should probably follow
page-allocator-do-not-sanity-check-order-in-the-fast-path-fix.patch

Cc'ed DaveM and netdev, just in case they're surprised it was asking for
so much, or disappointed it's not getting as much as it was asking for.

 mm/page_alloc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- 2.6.30-rc3-mm1/mm/page_alloc.c	2009-04-29 21:01:08.000000000 +0100
+++ mmotm/mm/page_alloc.c	2009-04-29 21:12:04.000000000 +0100
@@ -4765,7 +4765,10 @@ void *__init alloc_large_system_hash(con
 			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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-05-01 17:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-29 21:09 [PATCH mmotm] mm: alloc_large_system_hash check order Hugh Dickins
2009-04-29 21:28 ` Andrew Morton
2009-05-01 13:40   ` Hugh Dickins
2009-05-01 13:45     ` [PATCH 2.6.30] Doc: hashdist defaults on for 64bit Hugh Dickins
2009-05-01 14:29       ` Mel Gorman
2009-05-01 17:20       ` David Miller
2009-04-30  0:25 ` [PATCH mmotm] mm: alloc_large_system_hash check order David Miller
2009-04-30 13:25 ` Mel Gorman
2009-05-01 11:30   ` Hugh Dickins
2009-05-01 11:46     ` Eric Dumazet
2009-05-01 12:05       ` Hugh Dickins
2009-05-01 14:00     ` Mel Gorman
2009-05-01 13:59       ` Christoph Lameter
2009-05-01 15:09         ` Mel Gorman
2009-05-01 15:14           ` Christoph Lameter
2009-05-01 14:12       ` Mel Gorman
2009-05-01 14:28       ` Hugh Dickins
2009-05-01 14:43         ` Mel Gorman

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).