Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151518
b: refs/heads/master
c: 78dc583
h: refs/heads/master
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Jun 17, 2009
1 parent a708016 commit 717ce50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 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: d2bf6be8ab63aa84e6149aac934649aadf3828b1
refs/heads/master: 78dc583d3ab43115579cb5f3f7bd12e3548dd5a5
29 changes: 15 additions & 14 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,19 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
unsigned long nr_scanned = 0;
unsigned long nr_reclaimed = 0;
struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
int lumpy_reclaim = 0;

/*
* If we need a large contiguous chunk of memory, or have
* trouble getting a small set of contiguous pages, we
* will reclaim both active and inactive pages.
*
* We use the same threshold as pageout congestion_wait below.
*/
if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
lumpy_reclaim = 1;
else if (sc->order && priority < DEF_PRIORITY - 2)
lumpy_reclaim = 1;

pagevec_init(&pvec, 1);

Expand All @@ -1073,19 +1086,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
unsigned long nr_freed;
unsigned long nr_active;
unsigned int count[NR_LRU_LISTS] = { 0, };
int mode = ISOLATE_INACTIVE;

/*
* If we need a large contiguous chunk of memory, or have
* trouble getting a small set of contiguous pages, we
* will reclaim both active and inactive pages.
*
* We use the same threshold as pageout congestion_wait below.
*/
if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
mode = ISOLATE_BOTH;
else if (sc->order && priority < DEF_PRIORITY - 2)
mode = ISOLATE_BOTH;
int mode = lumpy_reclaim ? ISOLATE_BOTH : ISOLATE_INACTIVE;

nr_taken = sc->isolate_pages(sc->swap_cluster_max,
&page_list, &nr_scan, sc->order, mode,
Expand Down Expand Up @@ -1122,7 +1123,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
* but that should be acceptable to the caller
*/
if (nr_freed < nr_taken && !current_is_kswapd() &&
sc->order > PAGE_ALLOC_COSTLY_ORDER) {
lumpy_reclaim) {
congestion_wait(WRITE, HZ/10);

/*
Expand Down

0 comments on commit 717ce50

Please sign in to comment.