aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2006-01-06 03:11:01 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:25 -0500
commit085cc7d5de3cc662da7ea78296464a0d52f3f01f (patch)
tree0fc8bc9ef25929b1bfc2bfb444eb62e6bc5468ff
parenta86b1f53166a260ced8f3c8c526945bf496f2e78 (diff)
[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>
-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)
447 * 447 *
448 * -- wli 448 * -- wli
449 */ 449 */
450static inline struct page * 450static inline void expand(struct zone *zone, struct page *page,
451expand(struct zone *zone, struct page *page,
452 int low, int high, struct free_area *area) 451 int low, int high, struct free_area *area)
453{ 452{
454 unsigned long size = 1 << high; 453 unsigned long size = 1 << high;
@@ -462,7 +461,6 @@ expand(struct zone *zone, struct page *page,
462 area->nr_free++; 461 area->nr_free++;
463 set_page_order(&page[size], high); 462 set_page_order(&page[size], high);
464 } 463 }
465 return page;
466} 464}
467 465
468/* 466/*
@@ -522,7 +520,8 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order)
522 rmv_page_order(page); 520 rmv_page_order(page);
523 area->nr_free--; 521 area->nr_free--;
524 zone->free_pages -= 1UL << order; 522 zone->free_pages -= 1UL << order;
525 return expand(zone, page, order, current_order, area); 523 expand(zone, page, order, current_order, area);
524 return page;
526 } 525 }
527 526
528 return NULL; 527 return NULL;
@@ -537,19 +536,16 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
537 unsigned long count, struct list_head *list) 536 unsigned long count, struct list_head *list)
538{ 537{
539 int i; 538 int i;
540 int allocated = 0;
541 struct page *page;
542 539
543 spin_lock(&zone->lock); 540 spin_lock(&zone->lock);
544 for (i = 0; i < count; ++i) { 541 for (i = 0; i < count; ++i) {
545 page = __rmqueue(zone, order); 542 struct page *page = __rmqueue(zone, order);
546 if (page == NULL) 543 if (unlikely(page == NULL))
547 break; 544 break;
548 allocated++;
549 list_add_tail(&page->lru, list); 545 list_add_tail(&page->lru, list);
550 } 546 }
551 spin_unlock(&zone->lock); 547 spin_unlock(&zone->lock);
552 return allocated; 548 return i;
553} 549}
554 550
555#ifdef CONFIG_NUMA 551#ifdef CONFIG_NUMA