Mel Gorman 793462
From 1979ba9634fc017fe0e68bc6b3032eb6943e17fe Mon Sep 17 00:00:00 2001
Mel Gorman 793462
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
Mel Gorman 793462
Date: Wed, 4 Oct 2017 08:39:27 +0100
Mel Gorman 793462
Subject: [PATCH] mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter
Mel Gorman 793462
Mel Gorman 657446
Patch-Mainline: v4.14
Mel Gorman 657446
Git-commit: de55c8b251974247edda38e952da8e8dd71683ec
Mel Gorman 793462
References: VM Performance, bnc#959436
Mel Gorman 793462
Mel Gorman 793462
3a321d2a3dde81214 ("mm: change the call sites of numa statistics items")
Mel Gorman 793462
separated NUMA counters from zone counters, but the NUMA_INTERLEAVE_HIT
Mel Gorman 793462
call site wasn't updated to use the new interface.  So
Mel Gorman 793462
alloc_page_interleave() actually increments NR_ZONE_INACTIVE_FILE instead
Mel Gorman 793462
of NUMA_INTERLEAVE_HIT.
Mel Gorman 793462
Mel Gorman 793462
Fix this by using __inc_numa_state() interface to increment
Mel Gorman 793462
NUMA_INTERLEAVE_HIT.
Mel Gorman 793462
Mel Gorman 793462
Link: http://lkml.kernel.org/r/20171003191003.8573-1-aryabinin@virtuozzo.com
Mel Gorman 793462
Fixes: 3a321d2a3dde ("mm: change the call sites of numa statistics items")
Mel Gorman 793462
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Mel Gorman 793462
Acked-by: Mel Gorman <mgorman@suse.de>
Mel Gorman 793462
Cc: Kemi Wang <kemi.wang@intel.com>
Mel Gorman 793462
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Mel Gorman 793462
Signed-off-by: Mel Gorman <mgorman@suse.de>
Mel Gorman 793462
---
Mel Gorman 793462
 mm/mempolicy.c | 7 +++++--
Mel Gorman 793462
 1 file changed, 5 insertions(+), 2 deletions(-)
Mel Gorman 793462
Mel Gorman 793462
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
Mel Gorman 793462
index e0157546e6b5..ccfb949b4e7f 100644
Mel Gorman 793462
--- a/mm/mempolicy.c
Mel Gorman 793462
+++ b/mm/mempolicy.c
Mel Gorman 793462
@@ -1932,8 +1932,11 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
Mel Gorman 793462
 
Mel Gorman 793462
 	zl = node_zonelist(nid, gfp);
Mel Gorman 793462
 	page = __alloc_pages(gfp, order, zl);
Mel Gorman 793462
-	if (page && page_zone(page) == zonelist_zone(&zl->_zonerefs[0]))
Mel Gorman 793462
-		inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
Mel Gorman 793462
+	if (page && page_zone(page) == zonelist_zone(&zl->_zonerefs[0])) {
Mel Gorman 793462
+		preempt_disable();
Mel Gorman 793462
+		__inc_numa_state(page_zone(page), NUMA_INTERLEAVE_HIT);
Mel Gorman 793462
+		preempt_enable();
Mel Gorman 793462
+	}
Mel Gorman 793462
 	return page;
Mel Gorman 793462
 }
Mel Gorman 793462