|
@@ -1463,20 +1463,26 @@ static int inactive_file_is_low(struct zone *zone, struct scan_control *sc)
|
|
|
return low;
|
|
|
}
|
|
|
|
|
|
+static int inactive_list_is_low(struct zone *zone, struct scan_control *sc,
|
|
|
+ int file)
|
|
|
+{
|
|
|
+ if (file)
|
|
|
+ return inactive_file_is_low(zone, sc);
|
|
|
+ else
|
|
|
+ return inactive_anon_is_low(zone, sc);
|
|
|
+}
|
|
|
+
|
|
|
static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
|
|
|
struct zone *zone, struct scan_control *sc, int priority)
|
|
|
{
|
|
|
int file = is_file_lru(lru);
|
|
|
|
|
|
- if (lru == LRU_ACTIVE_FILE && inactive_file_is_low(zone, sc)) {
|
|
|
- shrink_active_list(nr_to_scan, zone, sc, priority, file);
|
|
|
+ if (is_active_lru(lru)) {
|
|
|
+ if (inactive_list_is_low(zone, sc, file))
|
|
|
+ shrink_active_list(nr_to_scan, zone, sc, priority, file);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if (lru == LRU_ACTIVE_ANON && inactive_anon_is_low(zone, sc)) {
|
|
|
- shrink_active_list(nr_to_scan, zone, sc, priority, file);
|
|
|
- return 0;
|
|
|
- }
|
|
|
return shrink_inactive_list(nr_to_scan, zone, sc, priority, file);
|
|
|
}
|
|
|
|