All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 048/101] mm: vmstat: replace __count_zone_vm_events with a zone id equivalent
@ 2016-07-28 22:46 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-07-28 22:46 UTC (permalink / raw)
  To: torvalds, mm-commits, akpm, mgorman, hannes, hillf.zj,
	iamjoonsoo.kim, mhocko, minchan, riel, vbabka

From: Mel Gorman <mgorman@techsingularity.net>
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().

Link: http://lkml.kernel.org/r/1467970510-21195-32-git-send-email-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/vmstat.h |    5 ++---
 mm/page_alloc.c        |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff -puN include/linux/vmstat.h~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent include/linux/vmstat.h
--- a/include/linux/vmstat.h~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent
+++ a/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.
diff -puN mm/page_alloc.c~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent mm/page_alloc.c
--- a/mm/page_alloc.c~mm-vmstat-replace-__count_zone_vm_events-with-a-zone-id-equivalent
+++ a/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);
 
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-28 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-28 22:46 [patch 048/101] mm: vmstat: replace __count_zone_vm_events with a zone id equivalent akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.