# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1170644129 -32400 # Node ID b641ff64e981bfd019c4965f05d8f29cd8944000 # Parent fbc128aafdeb9c3726495211e0b017951672912a fix tlbflush_clock. arch_vcpu.tlbflush_timestam is unused and new_tlbflush_clock_period() flushes vhpt unnecessary. PATCHNAME: tlbflush_clock_fix Signed-off-by: Isaku Yamahata diff -r fbc128aafdeb -r b641ff64e981 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Sun Feb 04 12:24:53 2007 -0700 +++ b/xen/arch/ia64/xen/domain.c Mon Feb 05 11:55:29 2007 +0900 @@ -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 fbc128aafdeb -r b641ff64e981 xen/arch/ia64/xen/flushtlb.c --- a/xen/arch/ia64/xen/flushtlb.c Sun Feb 04 12:24:53 2007 -0700 +++ b/xen/arch/ia64/xen/flushtlb.c Mon Feb 05 11:55:29 2007 +0900 @@ -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 fbc128aafdeb -r b641ff64e981 xen/arch/ia64/xen/vhpt.c --- a/xen/arch/ia64/xen/vhpt.c Sun Feb 04 12:24:53 2007 -0700 +++ b/xen/arch/ia64/xen/vhpt.c Mon Feb 05 11:55:29 2007 +0900 @@ -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 fbc128aafdeb -r b641ff64e981 xen/include/asm-ia64/domain.h --- a/xen/include/asm-ia64/domain.h Sun Feb 04 12:24:53 2007 -0700 +++ b/xen/include/asm-ia64/domain.h Mon Feb 05 11:55:29 2007 +0900 @@ -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; };