Skip to contentSkip to conversation

mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter

PATCH New [email protected] 1 participant 1 message Oct 13, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 5/18 mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter

From: Andrey Ryabinin <[email protected]>
Subject: mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter

3a321d2a3dde81214 ("mm: change the call sites of numa statistics items") separated NUMA counters from zone counters, but the NUMA_INTERLEAVE_HIT call site wasn't updated to use the new interface. So alloc_page_interleave() actually increments NR_ZONE_INACTIVE_FILE instead of NUMA_INTERLEAVE_HIT.

Fix this by using __inc_numa_state() interface to increment NUMA_INTERLEAVE_HIT.

Fixes 3a321d2a3dde ("mm: change the call sites of numa statistics items")
Cc Kemi Wang <[email protected]>

---

 mm/mempolicy.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
mm/mempolicy.c renamed from mm/mempolicy.c~mm-mempolicy-fix-numa_interleave_hit-counter +5 -2
diff -puN mm/mempolicy.c~mm-mempolicy-fix-numa_interleave_hit-counter mm/mempolicy.c
@@ -1920,8 +1920,11 @@ static struct page *alloc_page_interleav
 	struct page *page;
 
 	page = __alloc_pages(gfp, order, nid);
-	if (page && page_to_nid(page) == nid)
-		inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
+	if (page && page_to_nid(page) == nid) {
+		preempt_disable();
+		__inc_numa_state(page_zone(page), NUMA_INTERLEAVE_HIT);
+		preempt_enable();
+	}
 	return page;
 }
 

_