Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126233
b: refs/heads/master
c: 01dbe5c
h: refs/heads/master
i:
  126231: 70927c4
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Jan 6, 2009
1 parent cd1e368 commit 448bb75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: a79311c14eae4bb946a97af25f3e1b17d625985d
refs/heads/master: 01dbe5c9b1004dab045cb7f38428258ca9cddc02
15 changes: 9 additions & 6 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,8 @@ static void shrink_zone(int priority, struct zone *zone,
unsigned long nr_to_scan;
unsigned long percent[2]; /* anon @ 0; file @ 1 */
enum lru_list l;
unsigned long nr_reclaimed = sc->nr_reclaimed;
unsigned long swap_cluster_max = sc->swap_cluster_max;

get_scan_ratio(zone, sc, percent);

Expand All @@ -1425,7 +1427,7 @@ static void shrink_zone(int priority, struct zone *zone,
}
zone->lru[l].nr_scan += scan;
nr[l] = zone->lru[l].nr_scan;
if (nr[l] >= sc->swap_cluster_max)
if (nr[l] >= swap_cluster_max)
zone->lru[l].nr_scan = 0;
else
nr[l] = 0;
Expand All @@ -1444,12 +1446,11 @@ static void shrink_zone(int priority, struct zone *zone,
nr[LRU_INACTIVE_FILE]) {
for_each_evictable_lru(l) {
if (nr[l]) {
nr_to_scan = min(nr[l],
(unsigned long)sc->swap_cluster_max);
nr_to_scan = min(nr[l], swap_cluster_max);
nr[l] -= nr_to_scan;

sc->nr_reclaimed += shrink_list(l, nr_to_scan,
zone, sc, priority);
nr_reclaimed += shrink_list(l, nr_to_scan,
zone, sc, priority);
}
}
/*
Expand All @@ -1460,11 +1461,13 @@ static void shrink_zone(int priority, struct zone *zone,
* with multiple processes reclaiming pages, the total
* freeing target can get unreasonably large.
*/
if (sc->nr_reclaimed > sc->swap_cluster_max &&
if (nr_reclaimed > swap_cluster_max &&
priority < DEF_PRIORITY && !current_is_kswapd())
break;
}

sc->nr_reclaimed = nr_reclaimed;

/*
* Even if we did not try to evict anon pages at all, we want to
* rebalance the anon lru active/inactive ratio.
Expand Down

0 comments on commit 448bb75

Please sign in to comment.