Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260400
b: refs/heads/master
c: 4508378
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Jul 26, 2011
1 parent 5086ca5 commit c3cbb83
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 1af8efe965676ab30d6c8a5b1fccc9229f339a3b
refs/heads/master: 4508378b9523e22a2a0175d8bf64d932fb10a67d
18 changes: 12 additions & 6 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
enum lru_list l;
int noswap = 0;
int force_scan = 0;
unsigned long nr_force_scan[2];


anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) +
Expand All @@ -1817,6 +1818,8 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
fraction[0] = 0;
fraction[1] = 1;
denominator = 1;
nr_force_scan[0] = 0;
nr_force_scan[1] = SWAP_CLUSTER_MAX;
goto out;
}

Expand All @@ -1828,6 +1831,8 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
fraction[0] = 1;
fraction[1] = 0;
denominator = 1;
nr_force_scan[0] = SWAP_CLUSTER_MAX;
nr_force_scan[1] = 0;
goto out;
}
}
Expand Down Expand Up @@ -1876,6 +1881,11 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
fraction[0] = ap;
fraction[1] = fp;
denominator = ap + fp + 1;
if (force_scan) {
unsigned long scan = SWAP_CLUSTER_MAX;
nr_force_scan[0] = div64_u64(scan * ap, denominator);
nr_force_scan[1] = div64_u64(scan * fp, denominator);
}
out:
for_each_evictable_lru(l) {
int file = is_file_lru(l);
Expand All @@ -1896,12 +1906,8 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
* memcg, priority drop can cause big latency. So, it's better
* to scan small amount. See may_noscan above.
*/
if (!scan && force_scan) {
if (file)
scan = SWAP_CLUSTER_MAX;
else if (!noswap)
scan = SWAP_CLUSTER_MAX;
}
if (!scan && force_scan)
scan = nr_force_scan[file];
nr[l] = scan;
}
}
Expand Down

0 comments on commit c3cbb83

Please sign in to comment.