mm: update_lru_size warn and reset bad lru_size
[cascardo/linux.git] / mm / vmstat.c
index 5e43004..a7de9ad 100644 (file)
@@ -600,19 +600,13 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z, gfp_t flags)
 unsigned long node_page_state(int node, enum zone_stat_item item)
 {
        struct zone *zones = NODE_DATA(node)->node_zones;
+       int i;
+       unsigned long count = 0;
 
-       return
-#ifdef CONFIG_ZONE_DMA
-               zone_page_state(&zones[ZONE_DMA], item) +
-#endif
-#ifdef CONFIG_ZONE_DMA32
-               zone_page_state(&zones[ZONE_DMA32], item) +
-#endif
-#ifdef CONFIG_HIGHMEM
-               zone_page_state(&zones[ZONE_HIGHMEM], item) +
-#endif
-               zone_page_state(&zones[ZONE_NORMAL], item) +
-               zone_page_state(&zones[ZONE_MOVABLE], item);
+       for (i = 0; i < MAX_NR_ZONES; i++)
+               count += zone_page_state(zones + i, item);
+
+       return count;
 }
 
 #endif
@@ -1010,6 +1004,9 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m,
                if (!memmap_valid_within(pfn, page, zone))
                        continue;
 
+               if (page_zone(page) != zone)
+                       continue;
+
                mtype = get_pageblock_migratetype(page);
 
                if (mtype < MIGRATE_TYPES)
@@ -1076,6 +1073,10 @@ static void pagetypeinfo_showmixedcount_print(struct seq_file *m,
                                continue;
 
                        page = pfn_to_page(pfn);
+
+                       if (page_zone(page) != zone)
+                               continue;
+
                        if (PageBuddy(page)) {
                                pfn += (1UL << page_order(page)) - 1;
                                continue;