]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/vmscan.c
mm: vmscan: move inactive_list_is_low() swap check to the caller
[linux.git] / mm / vmscan.c
index 94d73725813d3be8d72c4624fe7a3bec0631385a..252a63f98c376ae66f8d2997309f69da3b9054b4 100644 (file)
@@ -2226,13 +2226,6 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file,
        unsigned long refaults;
        unsigned long gb;
 
-       /*
-        * If we don't have swap space, anonymous page deactivation
-        * is pointless.
-        */
-       if (!file && !total_swap_pages)
-               return false;
-
        inactive = lruvec_lru_size(lruvec, inactive_lru, sc->reclaim_idx);
        active = lruvec_lru_size(lruvec, active_lru, sc->reclaim_idx);
 
@@ -2653,7 +2646,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc
         * Even if we did not try to evict anon pages at all, we want to
         * rebalance the anon lru active/inactive ratio.
         */
-       if (inactive_list_is_low(lruvec, false, sc, true))
+       if (total_swap_pages && inactive_list_is_low(lruvec, false, sc, true))
                shrink_active_list(SWAP_CLUSTER_MAX, lruvec,
                                   sc, LRU_ACTIVE_ANON);
 }