Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151534
b: refs/heads/master
c: 728ec98
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Jun 17, 2009
1 parent c538256 commit 8ed232c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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: a56f57ff94c25d5d80def06f3ed8fe7f99147762
refs/heads/master: 728ec980fb9fa2d65d9e05444079a53615985e7b
20 changes: 16 additions & 4 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
* Go through the free lists for the given migratetype and remove
* the smallest available page from the freelists
*/
static struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
static inline
struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
int migratetype)
{
unsigned int current_order;
Expand Down Expand Up @@ -831,8 +832,7 @@ static struct page *__rmqueue_fallback(struct zone *zone, int order,
}
}

/* Use MIGRATE_RESERVE rather than fail an allocation */
return __rmqueue_smallest(zone, order, MIGRATE_RESERVE);
return NULL;
}

/*
Expand All @@ -844,11 +844,23 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order,
{
struct page *page;

retry_reserve:
page = __rmqueue_smallest(zone, order, migratetype);

if (unlikely(!page))
if (unlikely(!page) && migratetype != MIGRATE_RESERVE) {
page = __rmqueue_fallback(zone, order, migratetype);

/*
* Use MIGRATE_RESERVE rather than fail an allocation. goto
* is used because __rmqueue_smallest is an inline function
* and we want just one call site
*/
if (!page) {
migratetype = MIGRATE_RESERVE;
goto retry_reserve;
}
}

return page;
}

Expand Down

0 comments on commit 8ed232c

Please sign in to comment.