Skip to contentSkip to conversation

mm: vmstat: replace __count_zone_vm_events with a zone id equivalent

PATCH New [email protected] 1 participant 1 message Jul 28, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 48/101 mm: vmstat: replace __count_zone_vm_events with a zone id equivalent

From: Mel Gorman <[email protected]>
Subject: mm: vmstat: replace __count_zone_vm_events with a zone id equivalent

This is partially a preparation patch for more vmstat work but it also has the slight advantage that __count_zid_vm_events is cheaper to calculate than __count_zone_vm_events().

---

 include/linux/vmstat.h |    5 ++---
 mm/page_alloc.c        |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
include/linux/vmstat.h renamed from include/linux/vmstat.h~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent +2 -3
diff -puN include/linux/vmstat.h~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent include/linux/vmstat.h
@@ -101,9 +101,8 @@ static inline void vm_events_fold_cpu(in
 #define count_vm_vmacache_event(x) do {} while (0)
 #endif
 
-#define __count_zone_vm_events(item, zone, delta) \
-		__count_vm_events(item##_NORMAL - ZONE_NORMAL + \
-		zone_idx(zone), delta)
+#define __count_zid_vm_events(item, zid, delta) \
+	__count_vm_events(item##_NORMAL - ZONE_NORMAL + zid, delta)
 
 /*
  * Zone and node-based page accounting with per cpu differentials.
mm/page_alloc.c renamed from mm/page_alloc.c~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent +1 -1
diff -puN mm/page_alloc.c~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent mm/page_alloc.c
@@ -2616,7 +2616,7 @@ struct page *buffered_rmqueue(struct zon
 					  get_pcppage_migratetype(page));
 	}
 
-	__count_zone_vm_events(PGALLOC, zone, 1 << order);
+	__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
 	zone_statistics(preferred_zone, zone, gfp_flags);
 	local_irq_restore(flags);
 

_