Put tlb_flush_others() latency measurements in debugfs.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/kernel/tlb_64.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c
--- a/arch/x86/kernel/tlb_64.c
+++ b/arch/x86/kernel/tlb_64.c
@@ -7,6 +7,7 @@
#include <linux/kernel_stat.h>
#include <linux/mc146818rtc.h>
#include <linux/interrupt.h>
+#include <linux/debugfs.h>
#include <asm/mtrr.h>
#include <asm/pgalloc.h>
@@ -17,6 +18,8 @@
#include <asm/idle.h>
#include <asm/uv/uv_hub.h>
#include <asm/uv/uv_bau.h>
+
+#include <asm/timer.h>
#include <mach_ipi.h>
/*
@@ -157,15 +160,29 @@
add_pda(irq_tlb_count, 1);
}
+#ifdef CONFIG_DEBUG_FS
+static spinlock_t tlbflush_others_lock = __SPIN_LOCK_UNLOCKED(tlb_flush_others_lock);
+static u32 tlbflush_others_count;
+static u64 tlbflush_others_accum;
+static u8 tlbflush_others_enable;
+#else
+#define tlbflush_others_enable 0
+#endif
+
void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
unsigned long va)
{
int sender;
union smp_flush_state *f;
cpumask_t cpumask = *cpumaskp;
+ u8 timing_enabled = tlbflush_others_enable;
+ u64 uninitialized_var(start), end;
if (is_uv_system() && uv_flush_tlb_others(&cpumask, mm, va))
return;
+
+ if (timing_enabled)
+ rdtscll(start);
/* Caller has disabled preemption */
sender = smp_processor_id() % NUM_INVALIDATE_TLB_VECTORS;
@@ -194,6 +211,15 @@
f->flush_mm = NULL;
f->flush_va = 0;
spin_unlock(&f->tlbstate_lock);
+
+ if (timing_enabled) {
+ rdtscll(end);
+
+ spin_lock(&tlbflush_others_lock);
+ tlbflush_others_count++;
+ tlbflush_others_accum += cycles_2_ns(end - start);
+ spin_unlock(&tlbflush_others_lock);
+ }
}
static int __cpuinit init_smp_flush(void)
@@ -277,3 +303,15 @@
{
on_each_cpu(do_flush_tlb_all, NULL, 1);
}
+
+#ifdef CONFIG_DEBUG_FS
+static int __init init_tlbflush_time(void)
+{
+ debugfs_create_u8("tlbflush_others_enable", 0644, NULL, &tlbflush_others_enable);
+ debugfs_create_u32("tlbflush_others_count", 0644, NULL, &tlbflush_others_count);
+ debugfs_create_u64("tlbflush_others_accum", 0644, NULL, &tlbflush_others_accum);
+
+ return 0;
+}
+fs_initcall(init_tlbflush_time);
+#endif
--
| Linus Torvalds | Linux 2.6.21-rc4 |
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| Andrew Morton | -mm merge plans for 2.6.23 |
| Stephane Eranian | Re: [PATCH] fix up perfmon to build on -mm |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Linus Torvalds | Re: silent semantic changes with reiser4 |
| jim owens | Re: ext4 - getting at birth time (file create time) and getting/setting nanosecond... |
| Alan Cox | Re: impact of 4k sector size on the IO & FS stack |
| Peter Zijlstra | Re: + mm-balance_dirty_pages-reduce-calls-to-global_page_state-to-reduce-c ache-re... |
