Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320822
b: refs/heads/master
c: cfd19c5
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Aug 1, 2012
1 parent 943c943 commit 6bdb894
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 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: 907aed48f65efeecf91575397e3d79335d93a466
refs/heads/master: cfd19c5a9ecf8e5e38de2603077c4330af21316e
27 changes: 14 additions & 13 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2116,8 +2116,8 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,

page = get_page_from_freelist(gfp_mask, nodemask,
order, zonelist, high_zoneidx,
alloc_flags, preferred_zone,
migratetype);
alloc_flags & ~ALLOC_NO_WATERMARKS,
preferred_zone, migratetype);
if (page) {
preferred_zone->compact_considered = 0;
preferred_zone->compact_defer_shift = 0;
Expand Down Expand Up @@ -2209,8 +2209,8 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
retry:
page = get_page_from_freelist(gfp_mask, nodemask, order,
zonelist, high_zoneidx,
alloc_flags, preferred_zone,
migratetype);
alloc_flags & ~ALLOC_NO_WATERMARKS,
preferred_zone, migratetype);

/*
* If an allocation failed after direct reclaim, it could be because
Expand Down Expand Up @@ -2381,8 +2381,17 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
page = __alloc_pages_high_priority(gfp_mask, order,
zonelist, high_zoneidx, nodemask,
preferred_zone, migratetype);
if (page)
if (page) {
/*
* page->pfmemalloc is set when ALLOC_NO_WATERMARKS was
* necessary to allocate the page. The expectation is
* that the caller is taking steps that will free more
* memory. The caller should avoid the page being used
* for !PFMEMALLOC purposes.
*/
page->pfmemalloc = true;
goto got_pg;
}
}

/* Atomic allocations - we can't balance anything */
Expand Down Expand Up @@ -2499,14 +2508,6 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
warn_alloc_failed(gfp_mask, order, NULL);
return page;
got_pg:
/*
* page->pfmemalloc is set when the caller had PFMEMALLOC set, is
* been OOM killed or specified __GFP_MEMALLOC. The expectation is
* that the caller is taking steps that will free more memory. The
* caller should avoid the page being used for !PFMEMALLOC purposes.
*/
page->pfmemalloc = !!(alloc_flags & ALLOC_NO_WATERMARKS);

if (kmemcheck_enabled)
kmemcheck_pagealloc_alloc(page, order, gfp_mask);

Expand Down

0 comments on commit 6bdb894

Please sign in to comment.