aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 2ef59d5b16a6..04658189b9a5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1463,20 +1463,26 @@ static int inactive_file_is_low(struct zone *zone, struct scan_control *sc)
1463 return low; 1463 return low;
1464} 1464}
1465 1465
1466static int inactive_list_is_low(struct zone *zone, struct scan_control *sc,
1467 int file)
1468{
1469 if (file)
1470 return inactive_file_is_low(zone, sc);
1471 else
1472 return inactive_anon_is_low(zone, sc);
1473}
1474
1466static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, 1475static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
1467 struct zone *zone, struct scan_control *sc, int priority) 1476 struct zone *zone, struct scan_control *sc, int priority)
1468{ 1477{
1469 int file = is_file_lru(lru); 1478 int file = is_file_lru(lru);
1470 1479
1471 if (lru == LRU_ACTIVE_FILE && inactive_file_is_low(zone, sc)) { 1480 if (is_active_lru(lru)) {
1472 shrink_active_list(nr_to_scan, zone, sc, priority, file); 1481 if (inactive_list_is_low(zone, sc, file))
1482 shrink_active_list(nr_to_scan, zone, sc, priority, file);
1473 return 0; 1483 return 0;
1474 } 1484 }
1475 1485
1476 if (lru == LRU_ACTIVE_ANON && inactive_anon_is_low(zone, sc)) {
1477 shrink_active_list(nr_to_scan, zone, sc, priority, file);
1478 return 0;
1479 }
1480 return shrink_inactive_list(nr_to_scan, zone, sc, priority, file); 1486 return shrink_inactive_list(nr_to_scan, zone, sc, priority, file);
1481} 1487}
1482 1488