aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2016-05-19 20:12:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 22:12:14 -0400
commit09b4ab3c433733127f8644290e94548a4cb8122f (patch)
tree0aa31af3626ef6cbd70dbb733aae3c1524c5f279 /mm/page-writeback.c
parentba6b0979e346fd91d3b7ef6956d7155877308f0f (diff)
mm/writeback: correct dirty page calculation for highmem
ZONE_MOVABLE could be treated as highmem so we need to consider it for accurate calculation of dirty pages. And, in following patches, ZONE_CMA will be introduced and it can be treated as highmem, too. So, instead of manually adding stat of ZONE_MOVABLE, looping all zones and check whether the zone is highmem or not and add stat of the zone which can be treated as highmem. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Laura Abbott <lauraa@codeaurora.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Michal Nazarewicz <mina86@mina86.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index bc5149d5ec38..3b88795ab46e 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -296,11 +296,15 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
296#ifdef CONFIG_HIGHMEM 296#ifdef CONFIG_HIGHMEM
297 int node; 297 int node;
298 unsigned long x = 0; 298 unsigned long x = 0;
299 int i;
299 300
300 for_each_node_state(node, N_HIGH_MEMORY) { 301 for_each_node_state(node, N_HIGH_MEMORY) {
301 struct zone *z = &NODE_DATA(node)->node_zones[ZONE_HIGHMEM]; 302 for (i = 0; i < MAX_NR_ZONES; i++) {
303 struct zone *z = &NODE_DATA(node)->node_zones[i];
302 304
303 x += zone_dirtyable_memory(z); 305 if (is_highmem(z))
306 x += zone_dirtyable_memory(z);
307 }
304 } 308 }
305 /* 309 /*
306 * Unreclaimable memory (kernel memory or anonymous memory 310 * Unreclaimable memory (kernel memory or anonymous memory