[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Fix tlbflush_clock



# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Date 1170710667 25200
# Node ID d9f7f4f9c7ff86484afb047accdad23e1482637f
# Parent  e0a5cef6332a70012768ba6d3a3abb893cb8eb92
[IA64] Fix tlbflush_clock

arch_vcpu.tlbflush_timestamp is unused and
new_tlbflush_clock_period() flushes vhpt unnecessarily.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/domain.c    |    3 --
 xen/arch/ia64/xen/flushtlb.c  |   44 +++++++-----------------------------------
 xen/arch/ia64/xen/vhpt.c      |    4 ---
 xen/include/asm-ia64/domain.h |    3 --
 4 files changed, 8 insertions(+), 46 deletions(-)

diff -r e0a5cef6332a -r d9f7f4f9c7ff xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Mon Feb 05 13:55:47 2007 -0700
+++ b/xen/arch/ia64/xen/domain.c        Mon Feb 05 14:24:27 2007 -0700
@@ -448,9 +448,6 @@ int vcpu_late_initialise(struct vcpu *v)
                assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i,
                                   virt_to_maddr(v->arch.privregs + i));
 
-       tlbflush_update_time(&v->arch.tlbflush_timestamp,
-                            tlbflush_current_time());
-
        return 0;
 }
 
diff -r e0a5cef6332a -r d9f7f4f9c7ff xen/arch/ia64/xen/flushtlb.c
--- a/xen/arch/ia64/xen/flushtlb.c      Mon Feb 05 13:55:47 2007 -0700
+++ b/xen/arch/ia64/xen/flushtlb.c      Mon Feb 05 14:24:27 2007 -0700
@@ -59,46 +59,18 @@ tlbflush_clock_inc_and_return(void)
     return t2;
 }
 
+static void
+tlbflush_clock_local_flush(void *unused)
+{
+    local_vhpt_flush();
+    local_flush_tlb_all();
+}
+
 void
 new_tlbflush_clock_period(void)
 {
-    /*
-     *XXX TODO
-     * If flushing all vcpu's vhpt takes too long, it can be done backgroundly.
-     * In such case tlbflush time comparison is done using only 31bit
-     * similar to linux jiffies comparison.
-     * vhpt should be flushed gradually before wraping 31bits.
-     *
-     * Sample calculation.
-     * Currently Xen/IA64 can create up to 64 domains at the same time.
-     * Vhpt size is currently 64KB. (This might be changed later though)
-     * Suppose each domains have 4 vcpus (or 16 vcpus).
-     * then the memory size which must be flushed is 16MB (64MB).
-     */    
-    struct domain* d;
-    struct vcpu* v;
-    /* flush all vhpt of vcpu of all existing domain. */
-    read_lock(&domlist_lock);
-    for_each_domain(d) {
-        for_each_vcpu(d, v) {
-            vcpu_purge_tr_entry(&PSCBX(v,dtlb));
-            vcpu_purge_tr_entry(&PSCBX(v,itlb));
-        }
-    }
-    smp_mb();
-    for_each_domain(d) {
-        for_each_vcpu(d, v) {
-            if (!test_bit(_VCPUF_initialised, &v->vcpu_flags) || VMX_DOMAIN(v))
-                continue;
-            if (HAS_PERVCPU_VHPT(v->domain))
-                vcpu_vhpt_flush(v);
-        }
-    }
-    read_unlock(&domlist_lock);
-    /* unlock has release semantics */
-
     /* flush all vhpt of physical cpu and mTLB */
-    on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
+    on_each_cpu(tlbflush_clock_local_flush, NULL, 1, 1);
 
     /*
      * if global TLB shootdown is finished, increment tlbflush_time
diff -r e0a5cef6332a -r d9f7f4f9c7ff xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c  Mon Feb 05 13:55:47 2007 -0700
+++ b/xen/arch/ia64/xen/vhpt.c  Mon Feb 05 14:24:27 2007 -0700
@@ -54,11 +54,7 @@ void
 void
 vcpu_vhpt_flush(struct vcpu* v)
 {
-       /* increment flush clock before flush */
-       u32 flush_time = tlbflush_clock_inc_and_return();
        __vhpt_flush(vcpu_vhpt_maddr(v));
-       /* this must be after flush */
-       tlbflush_update_time(&v->arch.tlbflush_timestamp, flush_time);
        perfc_incrc(vcpu_vhpt_flush);
 }
 
diff -r e0a5cef6332a -r d9f7f4f9c7ff xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Mon Feb 05 13:55:47 2007 -0700
+++ b/xen/include/asm-ia64/domain.h     Mon Feb 05 14:24:27 2007 -0700
@@ -200,9 +200,6 @@ struct arch_vcpu {
     struct page_info*   vhpt_page;
     unsigned long       vhpt_entries;
 #endif
-#ifdef CONFIG_XEN_IA64_TLBFLUSH_CLOCK
-    u32 tlbflush_timestamp;
-#endif
 #define INVALID_PROCESSOR       INT_MAX
     int last_processor;
 };

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.