From 664f96885360686026a493aeecfb911dbc71a16a Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Tue, 16 Jun 2009 15:32:19 -0700 Subject: [PATCH] --- yaml --- r: 151548 b: refs/heads/master c: a1dd268cf6306565a31a48deff8bf4f6b4b105f7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 13def7b3f944..320c91ea476d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 72807a74c0172376bba6b5b27702c9f702b526e9 +refs/heads/master: a1dd268cf6306565a31a48deff8bf4f6b4b105f7 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 85759cdd6973..8ca06d87dc1f 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -4699,26 +4699,13 @@ void *__init alloc_large_system_hash(const char *tablename, else if (hashdist) table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); else { - unsigned long order = get_order(size); - - 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. + * some pages at the end of hash table which + * alloc_pages_exact() automatically does */ - if (table) { - unsigned long alloc_end = (unsigned long)table + - (PAGE_SIZE << order); - unsigned long used = (unsigned long)table + - PAGE_ALIGN(size); - split_page(virt_to_page(table), order); - while (used < alloc_end) { - free_page(used); - used += PAGE_SIZE; - } - } + if (get_order(size) < MAX_ORDER) + table = alloc_pages_exact(size, GFP_ATOMIC); } } while (!table && size > PAGE_SIZE && --log2qty);