diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 85759cdd6973..8ca06d87dc1f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -4699,26 +4699,13 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
4699 | else if (hashdist) | 4699 | else if (hashdist) |
4700 | table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); | 4700 | table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); |
4701 | else { | 4701 | else { |
4702 | unsigned long order = get_order(size); | ||
4703 | |||
4704 | if (order < MAX_ORDER) | ||
4705 | table = (void *)__get_free_pages(GFP_ATOMIC, | ||
4706 | order); | ||
4707 | /* | 4702 | /* |
4708 | * If bucketsize is not a power-of-two, we may free | 4703 | * If bucketsize is not a power-of-two, we may free |
4709 | * some pages at the end of hash table. | 4704 | * some pages at the end of hash table which |
4705 | * alloc_pages_exact() automatically does | ||
4710 | */ | 4706 | */ |
4711 | if (table) { | 4707 | if (get_order(size) < MAX_ORDER) |
4712 | unsigned long alloc_end = (unsigned long)table + | 4708 | table = alloc_pages_exact(size, GFP_ATOMIC); |
4713 | (PAGE_SIZE << order); | ||
4714 | unsigned long used = (unsigned long)table + | ||
4715 | PAGE_ALIGN(size); | ||
4716 | split_page(virt_to_page(table), order); | ||
4717 | while (used < alloc_end) { | ||
4718 | free_page(used); | ||
4719 | used += PAGE_SIZE; | ||
4720 | } | ||
4721 | } | ||
4722 | } | 4709 | } |
4723 | } while (!table && size > PAGE_SIZE && --log2qty); | 4710 | } while (!table && size > PAGE_SIZE && --log2qty); |
4724 | 4711 | ||