diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7ca668e946e5..67f523c4711a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -82,6 +82,8 @@ DEFINE_PER_CPU(int, numa_node); | |||
82 | EXPORT_PER_CPU_SYMBOL(numa_node); | 82 | EXPORT_PER_CPU_SYMBOL(numa_node); |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | DEFINE_STATIC_KEY_TRUE(vm_numa_stat_key); | ||
86 | |||
85 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES | 87 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES |
86 | /* | 88 | /* |
87 | * N.B., Do NOT reference the '_numa_mem_' per cpu variable directly. | 89 | * N.B., Do NOT reference the '_numa_mem_' per cpu variable directly. |
@@ -2777,6 +2779,10 @@ static inline void zone_statistics(struct zone *preferred_zone, struct zone *z) | |||
2777 | #ifdef CONFIG_NUMA | 2779 | #ifdef CONFIG_NUMA |
2778 | enum numa_stat_item local_stat = NUMA_LOCAL; | 2780 | enum numa_stat_item local_stat = NUMA_LOCAL; |
2779 | 2781 | ||
2782 | /* skip numa counters update if numa stats is disabled */ | ||
2783 | if (!static_branch_likely(&vm_numa_stat_key)) | ||
2784 | return; | ||
2785 | |||
2780 | if (z->node != numa_node_id()) | 2786 | if (z->node != numa_node_id()) |
2781 | local_stat = NUMA_OTHER; | 2787 | local_stat = NUMA_OTHER; |
2782 | 2788 | ||