]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/vmscan.c
Revert "rmap: do not call mmu_notifier_invalidate_page() under ptl"
[mirror_ubuntu-artful-kernel.git] / mm / vmscan.c
index 9e95fafc026b4174331aee5b8dd91f0ba099a8c4..a1af041930a6b0a4ff3646cde896af327ce503a3 100644 (file)
@@ -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;
+                       }
                }
        }
 
@@ -2497,18 +2506,18 @@ static inline bool should_continue_reclaim(struct pglist_data *pgdat,
                return false;
 
        /* Consider stopping depending on scan and reclaim activity */
-       if (sc->gfp_mask & __GFP_REPEAT) {
+       if (sc->gfp_mask & __GFP_RETRY_MAYFAIL) {
                /*
-                * For __GFP_REPEAT allocations, stop reclaiming if the
+                * For __GFP_RETRY_MAYFAIL allocations, stop reclaiming if the
                 * full LRU list has been scanned and we are still failing
                 * to reclaim pages. This full LRU scan is potentially
-                * expensive but a __GFP_REPEAT caller really wants to succeed
+                * expensive but a __GFP_RETRY_MAYFAIL caller really wants to succeed
                 */
                if (!nr_reclaimed && !nr_scanned)
                        return false;
        } else {
                /*
-                * For non-__GFP_REPEAT allocations which can presumably
+                * For non-__GFP_RETRY_MAYFAIL allocations which can presumably
                 * fail without consequence, stop if we failed to reclaim
                 * any pages from the last SWAP_CLUSTER_MAX number of
                 * pages that were scanned. This will return to the