Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131653
b: refs/heads/master
c: 0cb5725
h: refs/heads/master
i:
  131651: 171c7fb
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Feb 21, 2009
1 parent 80245c4 commit d36590a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 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: 3049103ddfc9aac111916bd2f39ac6976c431517
refs/heads/master: 0cb57258fe01e9b21076b6a15b6aec7a24168228
23 changes: 11 additions & 12 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2057,39 +2057,38 @@ static unsigned long shrink_all_zones(unsigned long nr_pages, int prio,
int pass, struct scan_control *sc)
{
struct zone *zone;
unsigned long nr_to_scan, ret = 0;
enum lru_list l;
unsigned long ret = 0;

for_each_zone(zone) {
enum lru_list l;

if (!populated_zone(zone))
continue;

if (zone_is_all_unreclaimable(zone) && prio != DEF_PRIORITY)
continue;

for_each_evictable_lru(l) {
enum zone_stat_item ls = NR_LRU_BASE + l;
unsigned long lru_pages = zone_page_state(zone, ls);

/* For pass = 0, we don't shrink the active list */
if (pass == 0 &&
(l == LRU_ACTIVE || l == LRU_ACTIVE_FILE))
if (pass == 0 && (l == LRU_ACTIVE_ANON ||
l == LRU_ACTIVE_FILE))
continue;

zone->lru[l].nr_scan +=
(zone_page_state(zone, NR_LRU_BASE + l)
>> prio) + 1;
zone->lru[l].nr_scan += (lru_pages >> prio) + 1;
if (zone->lru[l].nr_scan >= nr_pages || pass > 3) {
unsigned long nr_to_scan;

zone->lru[l].nr_scan = 0;
nr_to_scan = min(nr_pages,
zone_page_state(zone,
NR_LRU_BASE + l));
nr_to_scan = min(nr_pages, lru_pages);
ret += shrink_list(l, nr_to_scan, zone,
sc, prio);
if (ret >= nr_pages)
return ret;
}
}
}

return ret;
}

Expand Down

0 comments on commit d36590a

Please sign in to comment.