mm/writeback: correct dirty page calculation for highmem
[deliverable/linux.git] / mm / page-writeback.c
index bc5149d5ec38016da91a8b1c85aeca0193143f0c..3b88795ab46e1a70752990bf4ce7da925d97908c 100644 (file)
@@ -296,11 +296,15 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
 #ifdef CONFIG_HIGHMEM
        int node;
        unsigned long x = 0;
+       int i;
 
        for_each_node_state(node, N_HIGH_MEMORY) {
-               struct zone *z = &NODE_DATA(node)->node_zones[ZONE_HIGHMEM];
+               for (i = 0; i < MAX_NR_ZONES; i++) {
+                       struct zone *z = &NODE_DATA(node)->node_zones[i];
 
-               x += zone_dirtyable_memory(z);
+                       if (is_highmem(z))
+                               x += zone_dirtyable_memory(z);
+               }
        }
        /*
         * Unreclaimable memory (kernel memory or anonymous memory
This page took 0.025819 seconds and 5 git commands to generate.