From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933130AbcDLKp6 (ORCPT ); Tue, 12 Apr 2016 06:45:58 -0400 Received: from outbound-smtp10.blacknight.com ([46.22.139.15]:42859 "EHLO outbound-smtp10.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933021AbcDLKpw (ORCPT ); Tue, 12 Apr 2016 06:45:52 -0400 From: Mel Gorman To: Andrew Morton , Linux-MM Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML , Mel Gorman Subject: [PATCH 27/28] mm: vmstat: Replace __count_zone_vm_events with a zone id equivalent Date: Tue, 12 Apr 2016 11:45:03 +0100 Message-Id: <1460457904-754-14-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1460457904-754-1-git-send-email-mgorman@techsingularity.net> References: <1460456783-30996-1-git-send-email-mgorman@techsingularity.net> <1460457904-754-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Signed-off-by: Mel Gorman --- include/linux/vmstat.h | 5 ++--- mm/page_alloc.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 24bca20ede8f..9360ef611f3e 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -101,9 +101,8 @@ static inline void vm_events_fold_cpu(int cpu) #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 --git a/mm/page_alloc.c b/mm/page_alloc.c index 490a3cd34b7d..6b20efec0f60 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2466,7 +2466,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone, 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); -- 2.6.4