ia64/xen-unstable

changeset 13839:d9f7f4f9c7ff

[IA64] Fix tlbflush_clock

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

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild2.aw
date Mon Feb 05 14:24:27 2007 -0700 (2007-02-05)
parents e0a5cef6332a
children d879bbaa3faa
files xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/flushtlb.c xen/arch/ia64/xen/vhpt.c xen/include/asm-ia64/domain.h
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Mon Feb 05 13:55:47 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Mon Feb 05 14:24:27 2007 -0700
     1.3 @@ -448,9 +448,6 @@ int vcpu_late_initialise(struct vcpu *v)
     1.4  		assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i,
     1.5  		                   virt_to_maddr(v->arch.privregs + i));
     1.6  
     1.7 -	tlbflush_update_time(&v->arch.tlbflush_timestamp,
     1.8 -	                     tlbflush_current_time());
     1.9 -
    1.10  	return 0;
    1.11  }
    1.12  
     2.1 --- a/xen/arch/ia64/xen/flushtlb.c	Mon Feb 05 13:55:47 2007 -0700
     2.2 +++ b/xen/arch/ia64/xen/flushtlb.c	Mon Feb 05 14:24:27 2007 -0700
     2.3 @@ -59,46 +59,18 @@ tlbflush_clock_inc_and_return(void)
     2.4      return t2;
     2.5  }
     2.6  
     2.7 +static void
     2.8 +tlbflush_clock_local_flush(void *unused)
     2.9 +{
    2.10 +    local_vhpt_flush();
    2.11 +    local_flush_tlb_all();
    2.12 +}
    2.13 +
    2.14  void
    2.15  new_tlbflush_clock_period(void)
    2.16  {
    2.17 -    /*
    2.18 -     *XXX TODO
    2.19 -     * If flushing all vcpu's vhpt takes too long, it can be done backgroundly.
    2.20 -     * In such case tlbflush time comparison is done using only 31bit
    2.21 -     * similar to linux jiffies comparison.
    2.22 -     * vhpt should be flushed gradually before wraping 31bits.
    2.23 -     *
    2.24 -     * Sample calculation.
    2.25 -     * Currently Xen/IA64 can create up to 64 domains at the same time.
    2.26 -     * Vhpt size is currently 64KB. (This might be changed later though)
    2.27 -     * Suppose each domains have 4 vcpus (or 16 vcpus).
    2.28 -     * then the memory size which must be flushed is 16MB (64MB).
    2.29 -     */    
    2.30 -    struct domain* d;
    2.31 -    struct vcpu* v;
    2.32 -    /* flush all vhpt of vcpu of all existing domain. */
    2.33 -    read_lock(&domlist_lock);
    2.34 -    for_each_domain(d) {
    2.35 -        for_each_vcpu(d, v) {
    2.36 -            vcpu_purge_tr_entry(&PSCBX(v,dtlb));
    2.37 -            vcpu_purge_tr_entry(&PSCBX(v,itlb));
    2.38 -        }
    2.39 -    }
    2.40 -    smp_mb();
    2.41 -    for_each_domain(d) {
    2.42 -        for_each_vcpu(d, v) {
    2.43 -            if (!test_bit(_VCPUF_initialised, &v->vcpu_flags) || VMX_DOMAIN(v))
    2.44 -                continue;
    2.45 -            if (HAS_PERVCPU_VHPT(v->domain))
    2.46 -                vcpu_vhpt_flush(v);
    2.47 -        }
    2.48 -    }
    2.49 -    read_unlock(&domlist_lock);
    2.50 -    /* unlock has release semantics */
    2.51 -
    2.52      /* flush all vhpt of physical cpu and mTLB */
    2.53 -    on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
    2.54 +    on_each_cpu(tlbflush_clock_local_flush, NULL, 1, 1);
    2.55  
    2.56      /*
    2.57       * if global TLB shootdown is finished, increment tlbflush_time
     3.1 --- a/xen/arch/ia64/xen/vhpt.c	Mon Feb 05 13:55:47 2007 -0700
     3.2 +++ b/xen/arch/ia64/xen/vhpt.c	Mon Feb 05 14:24:27 2007 -0700
     3.3 @@ -54,11 +54,7 @@ local_vhpt_flush(void)
     3.4  void
     3.5  vcpu_vhpt_flush(struct vcpu* v)
     3.6  {
     3.7 -	/* increment flush clock before flush */
     3.8 -	u32 flush_time = tlbflush_clock_inc_and_return();
     3.9  	__vhpt_flush(vcpu_vhpt_maddr(v));
    3.10 -	/* this must be after flush */
    3.11 -	tlbflush_update_time(&v->arch.tlbflush_timestamp, flush_time);
    3.12  	perfc_incrc(vcpu_vhpt_flush);
    3.13  }
    3.14  
     4.1 --- a/xen/include/asm-ia64/domain.h	Mon Feb 05 13:55:47 2007 -0700
     4.2 +++ b/xen/include/asm-ia64/domain.h	Mon Feb 05 14:24:27 2007 -0700
     4.3 @@ -200,9 +200,6 @@ struct arch_vcpu {
     4.4      struct page_info*   vhpt_page;
     4.5      unsigned long       vhpt_entries;
     4.6  #endif
     4.7 -#ifdef CONFIG_XEN_IA64_TLBFLUSH_CLOCK
     4.8 -    u32 tlbflush_timestamp;
     4.9 -#endif
    4.10  #define INVALID_PROCESSOR       INT_MAX
    4.11      int last_processor;
    4.12  };