Merge tag 'module-builtin_driver-v4.1-rc8' of git://git.kernel.org/pub/scm/linux...
[deliverable/linux.git] / mm / vmscan.c
index 8cb16ebaf3ed083a73fc9ed8104a20de71e77dde..e61445dce04e3cc83e9704e84f3d5bf9074b31db 100644 (file)
@@ -2683,7 +2683,8 @@ static bool pfmemalloc_watermark_ok(pg_data_t *pgdat)
 
        for (i = 0; i <= ZONE_NORMAL; i++) {
                zone = &pgdat->node_zones[i];
-               if (!populated_zone(zone))
+               if (!populated_zone(zone) ||
+                   zone_reclaimable_pages(zone) == 0)
                        continue;
 
                pfmemalloc_reserve += min_wmark_pages(zone);
@@ -3633,7 +3634,7 @@ int zone_reclaim_mode __read_mostly;
 #define RECLAIM_OFF 0
 #define RECLAIM_ZONE (1<<0)    /* Run shrink_inactive_list on the zone */
 #define RECLAIM_WRITE (1<<1)   /* Writeout pages during reclaim */
-#define RECLAIM_SWAP (1<<2)    /* Swap pages out during reclaim */
+#define RECLAIM_UNMAP (1<<2)   /* Unmap pages during reclaim */
 
 /*
  * Priority for ZONE_RECLAIM. This determines the fraction of pages
@@ -3675,12 +3676,12 @@ static long zone_pagecache_reclaimable(struct zone *zone)
        long delta = 0;
 
        /*
-        * If RECLAIM_SWAP is set, then all file pages are considered
+        * If RECLAIM_UNMAP is set, then all file pages are considered
         * potentially reclaimable. Otherwise, we have to worry about
         * pages like swapcache and zone_unmapped_file_pages() provides
         * a better estimate
         */
-       if (zone_reclaim_mode & RECLAIM_SWAP)
+       if (zone_reclaim_mode & RECLAIM_UNMAP)
                nr_pagecache_reclaimable = zone_page_state(zone, NR_FILE_PAGES);
        else
                nr_pagecache_reclaimable = zone_unmapped_file_pages(zone);
@@ -3711,15 +3712,15 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
                .order = order,
                .priority = ZONE_RECLAIM_PRIORITY,
                .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
-               .may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
+               .may_unmap = !!(zone_reclaim_mode & RECLAIM_UNMAP),
                .may_swap = 1,
        };
 
        cond_resched();
        /*
-        * We need to be able to allocate from the reserves for RECLAIM_SWAP
+        * We need to be able to allocate from the reserves for RECLAIM_UNMAP
         * and we also need to be able to write out pages for RECLAIM_WRITE
-        * and RECLAIM_SWAP.
+        * and RECLAIM_UNMAP.
         */
        p->flags |= PF_MEMALLOC | PF_SWAPWRITE;
        lockdep_set_current_reclaim_state(gfp_mask);
This page took 0.028701 seconds and 5 git commands to generate.