@@ -38,6 +38,7 @@ void accept_memory(phys_addr_t start, phys_addr_t end)
}
bitmap_clear(unaccepted_memory, range_start, len);
+ count_vm_events(ACCEPT_MEMORY, len * PMD_SIZE / PAGE_SIZE);
}
spin_unlock_irqrestore(&unaccepted_memory_lock, flags);
}
@@ -136,6 +136,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
#ifdef CONFIG_X86
DIRECT_MAP_LEVEL2_SPLIT,
DIRECT_MAP_LEVEL3_SPLIT,
+#endif
+#ifdef CONFIG_UNACCEPTED_MEMORY
+ ACCEPT_MEMORY,
#endif
NR_VM_EVENT_ITEMS
};
@@ -1397,6 +1397,9 @@ const char * const vmstat_text[] = {
"direct_map_level2_splits",
"direct_map_level3_splits",
#endif
+#ifdef CONFIG_UNACCEPTED_MEMORY
+ "accept_memory",
+#endif
#endif /* CONFIG_VM_EVENT_COUNTERS || CONFIG_MEMCG */
};
#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA || CONFIG_MEMCG */
The counter increased every time kernel accepts a memory region. The counter allows to see if memory acceptation is still ongoing and contributes to memory allocation latency. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> --- arch/x86/mm/unaccepted_memory.c | 1 + include/linux/vm_event_item.h | 3 +++ mm/vmstat.c | 3 +++ 3 files changed, 7 insertions(+)