ARM64: dts: rk3368: add vop display node
[firefly-linux-kernel-4.4.55.git] / mm / page-writeback.c
index fd51ebfc423fe69abf5ab3ed4e54bf020dc71568..1e6769449ac2ee3f4b49ac31882b1ae71dcd49a4 100644 (file)
@@ -278,7 +278,12 @@ static unsigned long zone_dirtyable_memory(struct zone *zone)
        unsigned long nr_pages;
 
        nr_pages = zone_page_state(zone, NR_FREE_PAGES);
-       nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
+       /*
+        * Pages reserved for the kernel should not be considered
+        * dirtyable, to prevent a situation where reclaim has to
+        * clean pages in order to balance the zones.
+        */
+       nr_pages -= min(nr_pages, zone->totalreserve_pages);
 
        nr_pages += zone_page_state(zone, NR_INACTIVE_FILE);
        nr_pages += zone_page_state(zone, NR_ACTIVE_FILE);
@@ -332,7 +337,12 @@ static unsigned long global_dirtyable_memory(void)
        unsigned long x;
 
        x = global_page_state(NR_FREE_PAGES);
-       x -= min(x, dirty_balance_reserve);
+       /*
+        * Pages reserved for the kernel should not be considered
+        * dirtyable, to prevent a situation where reclaim has to
+        * clean pages in order to balance the zones.
+        */
+       x -= min(x, totalreserve_pages);
 
        x += global_page_state(NR_INACTIVE_FILE);
        x += global_page_state(NR_ACTIVE_FILE);