aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmscan.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9e95fafc026b..e9210f825219 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2228,8 +2228,17 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
2228 } 2228 }
2229 2229
2230 if (unlikely(pgdatfile + pgdatfree <= total_high_wmark)) { 2230 if (unlikely(pgdatfile + pgdatfree <= total_high_wmark)) {
2231 scan_balance = SCAN_ANON; 2231 /*
2232 goto out; 2232 * Force SCAN_ANON if there are enough inactive
2233 * anonymous pages on the LRU in eligible zones.
2234 * Otherwise, the small LRU gets thrashed.
2235 */
2236 if (!inactive_list_is_low(lruvec, false, memcg, sc, false) &&
2237 lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx)
2238 >> sc->priority) {
2239 scan_balance = SCAN_ANON;
2240 goto out;
2241 }
2233 } 2242 }
2234 } 2243 }
2235 2244