Commit e87d59f7 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm/vmstat: make node_page_state() handles all zones by itself

node_page_state() manually adds statistics per each zone and returns
total value for all zones.  Whenever we add a new zone, we need to
consider this function and it's really troublesome.  Make it handle all
zones by itself.
Signed-off-by: default avatarJoonsoo Kim <>
Reviewed-by: default avatarAneesh Kumar K.V <>
Cc: Rik van Riel <>
Cc: Johannes Weiner <>
Cc: Mel Gorman <>
Cc: Laura Abbott <>
Cc: Minchan Kim <>
Cc: Marek Szyprowski <>
Cc: Michal Nazarewicz <>
Cc: Vlastimil Babka <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 33499bfe
......@@ -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;
zone_page_state(&zones[ZONE_DMA], item) +
zone_page_state(&zones[ZONE_DMA32], item) +
zone_page_state(&zones[ZONE_HIGHMEM], item) +
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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment