]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/vmscan.c
checkpatch: improve --git <commit-count> shortcut
[karo-tx-linux.git] / mm / vmscan.c
index a386454c015aa69fc9c1116e13500e3905b850e2..c4a2f4512fcaccf00e5ec6f41eddcdce0e18fb7d 100644 (file)
@@ -191,7 +191,7 @@ static bool sane_reclaim(struct scan_control *sc)
 }
 #endif
 
-static unsigned long zone_reclaimable_pages(struct zone *zone)
+unsigned long zone_reclaimable_pages(struct zone *zone)
 {
        unsigned long nr;
 
@@ -2507,10 +2507,8 @@ static inline bool compaction_ready(struct zone *zone, int order, int classzone_
  *
  * If a zone is deemed to be full of pinned pages then just give it a light
  * scan then give up on it.
- *
- * Returns true if a zone was reclaimable.
  */
-static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
+static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 {
        struct zoneref *z;
        struct zone *zone;
@@ -2518,7 +2516,6 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
        unsigned long nr_soft_scanned;
        gfp_t orig_mask;
        enum zone_type requested_highidx = gfp_zone(sc->gfp_mask);
-       bool reclaimable = false;
 
        /*
         * If the number of buffer_heads in the machine exceeds the maximum
@@ -2583,17 +2580,10 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
                                                &nr_soft_scanned);
                        sc->nr_reclaimed += nr_soft_reclaimed;
                        sc->nr_scanned += nr_soft_scanned;
-                       if (nr_soft_reclaimed)
-                               reclaimable = true;
                        /* need some check for avoid more shrink_zone() */
                }
 
-               if (shrink_zone(zone, sc, zone_idx(zone) == classzone_idx))
-                       reclaimable = true;
-
-               if (global_reclaim(sc) &&
-                   !reclaimable && zone_reclaimable(zone))
-                       reclaimable = true;
+               shrink_zone(zone, sc, zone_idx(zone) == classzone_idx);
        }
 
        /*
@@ -2601,8 +2591,6 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
         * promoted it to __GFP_HIGHMEM.
         */
        sc->gfp_mask = orig_mask;
-
-       return reclaimable;
 }
 
 /*
@@ -2627,7 +2615,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
        int initial_priority = sc->priority;
        unsigned long total_scanned = 0;
        unsigned long writeback_threshold;
-       bool zones_reclaimable;
 retry:
        delayacct_freepages_start();
 
@@ -2638,7 +2625,7 @@ retry:
                vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup,
                                sc->priority);
                sc->nr_scanned = 0;
-               zones_reclaimable = shrink_zones(zonelist, sc);
+               shrink_zones(zonelist, sc);
 
                total_scanned += sc->nr_scanned;
                if (sc->nr_reclaimed >= sc->nr_to_reclaim)
@@ -2685,10 +2672,6 @@ retry:
                goto retry;
        }
 
-       /* Any of the zones still reclaimable?  Don't OOM. */
-       if (zones_reclaimable)
-               return 1;
-
        return 0;
 }