Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115843
b: refs/heads/master
c: 33c120e
h: refs/heads/master
i:
  115841: 088d04f
  115839: 6c0a546
v: v3
  • Loading branch information
Rik van Riel authored and Linus Torvalds committed Oct 20, 2008
1 parent 0bf6799 commit 94ebea8
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: c5fdae469a6a26cd882d7fe0aa3fbfffb6b72fc5
refs/heads/master: 33c120ed2843090e2bd316de1588b8bf8b96cbde
20 changes: 16 additions & 4 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,8 @@ int isolate_lru_page(struct page *page)
* of reclaimed pages
*/
static unsigned long shrink_inactive_list(unsigned long max_scan,
struct zone *zone, struct scan_control *sc, int file)
struct zone *zone, struct scan_control *sc,
int priority, int file)
{
LIST_HEAD(page_list);
struct pagevec pvec;
Expand All @@ -927,8 +928,19 @@ 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 = (sc->order > PAGE_ALLOC_COSTLY_ORDER) ?
ISOLATE_BOTH : ISOLATE_INACTIVE;
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;

nr_taken = sc->isolate_pages(sc->swap_cluster_max,
&page_list, &nr_scan, sc->order, mode,
Expand Down Expand Up @@ -1172,7 +1184,7 @@ static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
shrink_active_list(nr_to_scan, zone, sc, priority, file);
return 0;
}
return shrink_inactive_list(nr_to_scan, zone, sc, file);
return shrink_inactive_list(nr_to_scan, zone, sc, priority, file);
}

/*
Expand Down

0 comments on commit 94ebea8

Please sign in to comment.