Skip to content

Commit de55c8b

Browse files
aryabinintorvalds
authored andcommitted
mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter
Commit 3a321d2 ("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. Link: http://lkml.kernel.org/r/20171003191003.8573-1-aryabinin@virtuozzo.com Fixes: 3a321d2 ("mm: change the call sites of numa statistics items") Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> Cc: Kemi Wang <kemi.wang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8a1ac5d commit de55c8b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎mm/mempolicy.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,8 +1920,11 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
19201920
struct page *page;
19211921

19221922
page = __alloc_pages(gfp, order, nid);
1923-
if (page && page_to_nid(page) == nid)
1924-
inc_zone_page_state(page, NUMA_INTERLEAVE_HIT);
1923+
if (page && page_to_nid(page) == nid) {
1924+
preempt_disable();
1925+
__inc_numa_state(page_zone(page), NUMA_INTERLEAVE_HIT);
1926+
preempt_enable();
1927+
}
19251928
return page;
19261929
}
19271930

0 commit comments

Comments
 (0)