Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151548
b: refs/heads/master
c: a1dd268
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Jun 17, 2009
1 parent 659b4fc commit 664f968
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72807a74c0172376bba6b5b27702c9f702b526e9
refs/heads/master: a1dd268cf6306565a31a48deff8bf4f6b4b105f7
21 changes: 4 additions & 17 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 664f968

Please sign in to comment.