Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233695
b: refs/heads/master
c: 2876592
h: refs/heads/master
i:
  233693: d5fce45
  233691: 65cff7a
  233687: fb351ac
  233679: 5567736
  233663: 36a6cc8
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Feb 25, 2011
1 parent 967f5b1 commit 3247813
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 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: ac3c8304190ed0daaa2fb01ce2a069be5e2a52a7
refs/heads/master: 2876592f231d436c295b67726313f6f3cfb6e243
32 changes: 22 additions & 10 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,16 +1841,28 @@ static inline bool should_continue_reclaim(struct zone *zone,
if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION))
return false;

/*
* If we failed to reclaim and have scanned the full list, stop.
* NOTE: Checking just nr_reclaimed would exit reclaim/compaction far
* faster but obviously would be less likely to succeed
* allocation. If this is desirable, use GFP_REPEAT to decide
* if both reclaimed and scanned should be checked or just
* reclaimed
*/
if (!nr_reclaimed && !nr_scanned)
return false;
/* Consider stopping depending on scan and reclaim activity */
if (sc->gfp_mask & __GFP_REPEAT) {
/*
* For __GFP_REPEAT allocations, stop reclaiming if the
* full LRU list has been scanned and we are still failing
* to reclaim pages. This full LRU scan is potentially
* expensive but a __GFP_REPEAT caller really wants to succeed
*/
if (!nr_reclaimed && !nr_scanned)
return false;
} else {
/*
* For non-__GFP_REPEAT allocations which can presumably
* fail without consequence, stop if we failed to reclaim
* any pages from the last SWAP_CLUSTER_MAX number of
* pages that were scanned. This will return to the
* caller faster at the risk reclaim/compaction and
* the resulting allocation attempt fails
*/
if (!nr_reclaimed)
return false;
}

/*
* If we have not reclaimed enough pages for compaction and the
Expand Down

0 comments on commit 3247813

Please sign in to comment.