direct-io.hg

changeset 14344:3be7f638cba0

[HVM] Speed up bulk p2m operations such as domain creation
by not flushing the shadows more often than is needed.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Mon Mar 12 09:44:34 2007 +0000 (2007-03-12)
parents 8a01644306ee
children bcd8d0387cbf
files xen/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/multi.c xen/include/asm-x86/domain.h
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Sun Mar 11 22:42:22 2007 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Mon Mar 12 09:44:34 2007 +0000
     1.3 @@ -2813,7 +2813,11 @@ shadow_write_p2m_entry(struct vcpu *v, u
     1.4         This is pretty heavy handed, but this is a rare operation
     1.5         (it might happen a dozen times during boot and then never
     1.6         again), so it doesn't matter too much. */
     1.7 -    shadow_blow_tables(d);
     1.8 +    if ( d->arch.paging.shadow.has_fast_mmio_entries )
     1.9 +    {
    1.10 +        shadow_blow_tables(d);
    1.11 +        d->arch.paging.shadow.has_fast_mmio_entries = 0;
    1.12 +    }
    1.13  #endif
    1.14  
    1.15      shadow_unlock(d);
     2.1 --- a/xen/arch/x86/mm/shadow/multi.c	Sun Mar 11 22:42:22 2007 +0000
     2.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Mon Mar 12 09:44:34 2007 +0000
     2.3 @@ -660,6 +660,8 @@ static always_inline void
     2.4      {
     2.5          /* Guest l1e maps MMIO space */
     2.6          *sp = sh_l1e_mmio(guest_l1e_get_gfn(*gp), gflags);
     2.7 +        if ( !d->arch.paging.shadow.has_fast_mmio_entries )
     2.8 +            d->arch.paging.shadow.has_fast_mmio_entries = 1;
     2.9          goto done;
    2.10      }
    2.11  
     3.1 --- a/xen/include/asm-x86/domain.h	Sun Mar 11 22:42:22 2007 +0000
     3.2 +++ b/xen/include/asm-x86/domain.h	Mon Mar 12 09:44:34 2007 +0000
     3.3 @@ -79,6 +79,9 @@ struct shadow_domain {
     3.4      struct shadow_page_info **hash_table;
     3.5      int hash_walking;  /* Some function is walking the hash table */
     3.6  
     3.7 +    /* Fast MMIO path heuristic */
     3.8 +    int has_fast_mmio_entries;
     3.9 +
    3.10      /* Shadow log-dirty bitmap */
    3.11      unsigned long *dirty_bitmap;
    3.12      unsigned int dirty_bitmap_size;  /* in pages, bit per page */