depends on m
tristate "Relocation testing module"
+config DEBUG_TLBFLUSH
+ bool "Add vmstat counters to analyze TLB handling"
+ depends on DEBUG_KERNEL
+ help
+ This option allows the user to see the TLB flushing behavior in
+ /proc/vmstat.
+
source "drivers/hwtracing/coresight/Kconfig"
#include <asm/cputype.h>
#include <asm/mmu.h>
+/* vmstat.h cannot be include here. We will remove this soon */
+#include <linux/vm_event_item.h>
+extern void _count_vm_tlb_event(enum vm_event_item);
+
/*
* Raw TLBI operations.
*
__tlbi(vmalle1);
dsb(nsh);
isb();
+ _count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
}
static inline void flush_tlb_all(void)
__tlbi(vmalle1is);
dsb(ish);
isb();
+ _count_vm_tlb_event(NR_TLB_FLUSH_ALL);
}
static inline void flush_tlb_mm(struct mm_struct *mm)
__tlbi_user(aside1is, asid);
dsb(ish);
mmu_notifier_arch_invalidate_secondary_tlbs(mm, 0, -1UL);
+ _count_vm_tlb_event(NR_TLB_FLUSH_ALL);
}
static inline void __flush_tlb_page_nosync(struct mm_struct *mm,
__tlbi_user(vale1is, addr);
mmu_notifier_arch_invalidate_secondary_tlbs(mm, uaddr & PAGE_MASK,
(uaddr & PAGE_MASK) + PAGE_SIZE);
+ _count_vm_tlb_event(NR_TLB_FLUSH_ONE);
}
static inline void flush_tlb_page_nosync(struct vm_area_struct *vma,
dsb(ish);
mmu_notifier_arch_invalidate_secondary_tlbs(vma->vm_mm, start, end);
+ _count_vm_tlb_event(NR_TLB_FLUSH_RANGE);
}
static inline void flush_tlb_range(struct vm_area_struct *vma,
NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
NR_TLB_LOCAL_FLUSH_ALL,
+ NR_TLB_LOCAL_FLUSH_RANGE,
NR_TLB_LOCAL_FLUSH_ONE,
+ NR_TLB_FLUSH_ALL,
+ NR_TLB_FLUSH_RANGE,
+ NR_TLB_FLUSH_ONE,
+ NR_TLB_SKIPPED,
#endif /* CONFIG_DEBUG_TLBFLUSH */
#ifdef CONFIG_SWAP
SWAP_RA,
"nr_tlb_remote_flush",
"nr_tlb_remote_flush_received",
"nr_tlb_local_flush_all",
+ "nr_tlb_local_flush_range",
"nr_tlb_local_flush_one",
+ "nr_tlb_flush_all",
+ "nr_tlb_flush_range",
+ "nr_tlb_flush_one",
+ "nr_tlb_skipped",
#endif /* CONFIG_DEBUG_TLBFLUSH */
#ifdef CONFIG_SWAP