Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210478
b: refs/heads/master
c: 9ee493c
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Sep 10, 2010
1 parent 7abbfe2 commit f33944e
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: aa45484031ddee09b06350ab8528bfe5b2c76d1c
refs/heads/master: 9ee493ce0a60bf42c0f8fd0b0fe91df5704a1cbf
20 changes: 16 additions & 4 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,7 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
struct page *page = NULL;
struct reclaim_state reclaim_state;
struct task_struct *p = current;
bool drained = false;

cond_resched();

Expand All @@ -1865,14 +1866,25 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,

cond_resched();

if (order != 0)
drain_all_pages();
if (unlikely(!(*did_some_progress)))
return NULL;

if (likely(*did_some_progress))
page = get_page_from_freelist(gfp_mask, nodemask, order,
retry:
page = get_page_from_freelist(gfp_mask, nodemask, order,
zonelist, high_zoneidx,
alloc_flags, preferred_zone,
migratetype);

/*
* If an allocation failed after direct reclaim, it could be because
* pages are pinned on the per-cpu lists. Drain them and try again
*/
if (!page && !drained) {
drain_all_pages();
drained = true;
goto retry;
}

return page;
}

Expand Down

0 comments on commit f33944e

Please sign in to comment.