Btrfs: check prepare_uptodate_page() error code earlier
[firefly-linux-kernel-4.4.55.git] / mm / page_alloc.c
index 59abb47b70ee4e77ba638d79504ef9b3d253f386..48aaf7b9f253e6ea68587caa1e7e3e254905936a 100644 (file)
@@ -224,6 +224,9 @@ static char * const zone_names[MAX_NR_ZONES] = {
         "HighMem",
 #endif
         "Movable",
+#ifdef CONFIG_ZONE_DEVICE
+        "Device",
+#endif
 };
 
 int min_free_kbytes = 1024;
@@ -5085,7 +5088,7 @@ static unsigned long __meminit zone_spanned_pages_in_node(int nid,
 {
        unsigned long zone_start_pfn, zone_end_pfn;
 
-       /* When hotadd a new node, the node should be empty */
+       /* When hotadd a new node from cpu_up(), the node should be empty */
        if (!node_start_pfn && !node_end_pfn)
                return 0;
 
@@ -5152,7 +5155,7 @@ static unsigned long __meminit zone_absent_pages_in_node(int nid,
        unsigned long zone_high = arch_zone_highest_possible_pfn[zone_type];
        unsigned long zone_start_pfn, zone_end_pfn;
 
-       /* When hotadd a new node, the node should be empty */
+       /* When hotadd a new node from cpu_up(), the node should be empty */
        if (!node_start_pfn && !node_end_pfn)
                return 0;
 
@@ -5476,7 +5479,8 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
        get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
        pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid,
-               (u64)start_pfn << PAGE_SHIFT, ((u64)end_pfn << PAGE_SHIFT) - 1);
+               (u64)start_pfn << PAGE_SHIFT,
+               end_pfn ? ((u64)end_pfn << PAGE_SHIFT) - 1 : 0);
 #endif
        calculate_node_totalpages(pgdat, start_pfn, end_pfn,
                                  zones_size, zholes_size);
@@ -6075,7 +6079,7 @@ void __init page_alloc_init(void)
 }
 
 /*
- * calculate_totalreserve_pages - called when sysctl_lower_zone_reserve_ratio
+ * calculate_totalreserve_pages - called when sysctl_lowmem_reserve_ratio
  *     or min_free_kbytes changes.
  */
 static void calculate_totalreserve_pages(void)
@@ -6119,7 +6123,7 @@ static void calculate_totalreserve_pages(void)
 
 /*
  * setup_per_zone_lowmem_reserve - called whenever
- *     sysctl_lower_zone_reserve_ratio changes.  Ensures that each zone
+ *     sysctl_lowmem_reserve_ratio changes.  Ensures that each zone
  *     has a correct pages reserved value, so an adequate number of
  *     pages are left in the zone after a successful __alloc_pages().
  */