X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=mm%2Fvmscan.c;h=e9210f825219c4ec944b747a84656c5e8f5fd007;hb=3f906ba23689a3f824424c50f3ae937c2c70f676;hp=9e95fafc026b4174331aee5b8dd91f0ba099a8c4;hpb=b6ffe9ba46016f8351896ccee33bebcd0e5ea7c0;p=karo-tx-linux.git 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, } if (unlikely(pgdatfile + pgdatfree <= total_high_wmark)) { - scan_balance = SCAN_ANON; - goto out; + /* + * Force SCAN_ANON if there are enough inactive + * anonymous pages on the LRU in eligible zones. + * Otherwise, the small LRU gets thrashed. + */ + if (!inactive_list_is_low(lruvec, false, memcg, sc, false) && + lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx) + >> sc->priority) { + scan_balance = SCAN_ANON; + goto out; + } } }