aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2006-01-06 00:11:01 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:25 -0800
commit085cc7d5de3cc662da7ea78296464a0d52f3f01f (patch)
tree0fc8bc9ef25929b1bfc2bfb444eb62e6bc5468ff /mm/page_alloc.c
parent[PATCH] mm: page_state fixes (diff)
downloadlinux-dev-085cc7d5de3cc662da7ea78296464a0d52f3f01f.tar.xz
linux-dev-085cc7d5de3cc662da7ea78296464a0d52f3f01f.zip
[PATCH] mm: page_alloc cleanups
Small cleanups that does not change generated code with the gcc's I've tested with. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 379618747deb..925b0b985f79 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -447,8 +447,7 @@ void __free_pages_ok(struct page *page, unsigned int order)
*
* -- wli
*/
-static inline struct page *
-expand(struct zone *zone, struct page *page,
+static inline void expand(struct zone *zone, struct page *page,
int low, int high, struct free_area *area)
{
unsigned long size = 1 << high;
@@ -462,7 +461,6 @@ expand(struct zone *zone, struct page *page,
area->nr_free++;
set_page_order(&page[size], high);
}
- return page;
}
/*
@@ -522,7 +520,8 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order)
rmv_page_order(page);
area->nr_free--;
zone->free_pages -= 1UL << order;
- return expand(zone, page, order, current_order, area);
+ expand(zone, page, order, current_order, area);
+ return page;
}
return NULL;
@@ -537,19 +536,16 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
unsigned long count, struct list_head *list)
{
int i;
- int allocated = 0;
- struct page *page;
spin_lock(&zone->lock);
for (i = 0; i < count; ++i) {
- page = __rmqueue(zone, order);
- if (page == NULL)
+ struct page *page = __rmqueue(zone, order);
+ if (unlikely(page == NULL))
break;
- allocated++;
list_add_tail(&page->lru, list);
}
spin_unlock(&zone->lock);
- return allocated;
+ return i;
}
#ifdef CONFIG_NUMA