|
@@ -1466,30 +1466,23 @@ static void shrink_zone(int priority, struct zone *zone,
|
|
get_scan_ratio(zone, sc, percent);
|
|
get_scan_ratio(zone, sc, percent);
|
|
|
|
|
|
for_each_evictable_lru(l) {
|
|
for_each_evictable_lru(l) {
|
|
- if (scan_global_lru(sc)) {
|
|
|
|
- int file = is_file_lru(l);
|
|
|
|
- int scan;
|
|
|
|
|
|
+ int file = is_file_lru(l);
|
|
|
|
+ int scan;
|
|
|
|
|
|
- scan = zone_page_state(zone, NR_LRU_BASE + l);
|
|
|
|
- if (priority) {
|
|
|
|
- scan >>= priority;
|
|
|
|
- scan = (scan * percent[file]) / 100;
|
|
|
|
- }
|
|
|
|
|
|
+ scan = zone_page_state(zone, NR_LRU_BASE + l);
|
|
|
|
+ if (priority) {
|
|
|
|
+ scan >>= priority;
|
|
|
|
+ scan = (scan * percent[file]) / 100;
|
|
|
|
+ }
|
|
|
|
+ if (scan_global_lru(sc)) {
|
|
zone->lru[l].nr_scan += scan;
|
|
zone->lru[l].nr_scan += scan;
|
|
nr[l] = zone->lru[l].nr_scan;
|
|
nr[l] = zone->lru[l].nr_scan;
|
|
if (nr[l] >= swap_cluster_max)
|
|
if (nr[l] >= swap_cluster_max)
|
|
zone->lru[l].nr_scan = 0;
|
|
zone->lru[l].nr_scan = 0;
|
|
else
|
|
else
|
|
nr[l] = 0;
|
|
nr[l] = 0;
|
|
- } else {
|
|
|
|
- /*
|
|
|
|
- * This reclaim occurs not because zone memory shortage
|
|
|
|
- * but because memory controller hits its limit.
|
|
|
|
- * Don't modify zone reclaim related data.
|
|
|
|
- */
|
|
|
|
- nr[l] = mem_cgroup_calc_reclaim(sc->mem_cgroup, zone,
|
|
|
|
- priority, l);
|
|
|
|
- }
|
|
|
|
|
|
+ } else
|
|
|
|
+ nr[l] = scan;
|
|
}
|
|
}
|
|
|
|
|
|
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
|
|
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
|