From 71ee5ff2c9b326810d60a605eb84852e434d038c Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 5 Jan 2007 16:36:30 -0800 Subject: [PATCH] --- yaml --- r: 45245 b: refs/heads/master c: 9ab37b8f21b4dfe256d736c13738d20c88a1f3ad h: refs/heads/master i: 45243: 38012858abd834a256e27eb8de304ea5013851ac v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 068cad697581..3c5bfdb7ae72 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dd0ec16fa6cf2498b831663a543e1b67fce6e155 +refs/heads/master: 9ab37b8f21b4dfe256d736c13738d20c88a1f3ad diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 8c1a116875bc..4a9a83fc1b39 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -3321,6 +3321,10 @@ void *__init alloc_large_system_hash(const char *tablename, numentries >>= (scale - PAGE_SHIFT); else numentries <<= (PAGE_SHIFT - scale); + + /* Make sure we've got at least a 0-order allocation.. */ + if (unlikely((numentries * bucketsize) < PAGE_SIZE)) + numentries = PAGE_SIZE / bucketsize; } numentries = roundup_pow_of_two(numentries);