]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/page-writeback.c
mm: consider compaction feedback also for costly allocation
[karo-tx-linux.git] / mm / page-writeback.c
index 999792d35ccc0faee6c4f85d70b6e31876855284..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
@@ -1910,7 +1914,8 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
        if (gdtc->dirty > gdtc->bg_thresh)
                return true;
 
-       if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(gdtc))
+       if (wb_stat(wb, WB_RECLAIMABLE) >
+           wb_calc_thresh(gdtc->wb, gdtc->bg_thresh))
                return true;
 
        if (mdtc) {
@@ -1924,7 +1929,8 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
                if (mdtc->dirty > mdtc->bg_thresh)
                        return true;
 
-               if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(mdtc))
+               if (wb_stat(wb, WB_RECLAIMABLE) >
+                   wb_calc_thresh(mdtc->wb, mdtc->bg_thresh))
                        return true;
        }