Commit 085cc7d5 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] mm: page_alloc cleanups

Small cleanups that does not change generated code with the gcc's I've tested
with.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a86b1f53
...@@ -447,8 +447,7 @@ void __free_pages_ok(struct page *page, unsigned int order) ...@@ -447,8 +447,7 @@ void __free_pages_ok(struct page *page, unsigned int order)
* *
* -- wli * -- wli
*/ */
static inline struct page * static inline void expand(struct zone *zone, struct page *page,
expand(struct zone *zone, struct page *page,
int low, int high, struct free_area *area) int low, int high, struct free_area *area)
{ {
unsigned long size = 1 << high; unsigned long size = 1 << high;
...@@ -462,7 +461,6 @@ expand(struct zone *zone, struct page *page, ...@@ -462,7 +461,6 @@ expand(struct zone *zone, struct page *page,
area->nr_free++; area->nr_free++;
set_page_order(&page[size], high); set_page_order(&page[size], high);
} }
return page;
} }
/* /*
...@@ -522,7 +520,8 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order) ...@@ -522,7 +520,8 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order)
rmv_page_order(page); rmv_page_order(page);
area->nr_free--; area->nr_free--;
zone->free_pages -= 1UL << order; zone->free_pages -= 1UL << order;
return expand(zone, page, order, current_order, area); expand(zone, page, order, current_order, area);
return page;
} }
return NULL; return NULL;
...@@ -537,19 +536,16 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, ...@@ -537,19 +536,16 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
unsigned long count, struct list_head *list) unsigned long count, struct list_head *list)
{ {
int i; int i;
int allocated = 0;
struct page *page;
spin_lock(&zone->lock); spin_lock(&zone->lock);
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
page = __rmqueue(zone, order); struct page *page = __rmqueue(zone, order);
if (page == NULL) if (unlikely(page == NULL))
break; break;
allocated++;
list_add_tail(&page->lru, list); list_add_tail(&page->lru, list);
} }
spin_unlock(&zone->lock); spin_unlock(&zone->lock);
return allocated; return i;
} }
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment