ia64/xen-unstable

changeset 5790:ebfde26a769a

Avoid some unnecessary TLB flushes. This will probably make no real
difference on any sensible guest operating system.

Signed-off-by: Steven Smith, sos22@cl.cam.ac.uk.
author sos22@douglas.cl.cam.ac.uk
date Fri Jul 15 09:24:29 2005 +0000 (2005-07-15)
parents e8b48f3a2843
children 35b74976f598
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Fri Jul 15 09:09:57 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Fri Jul 15 09:24:29 2005 +0000
     1.3 @@ -1352,18 +1352,22 @@ int get_page_type(struct pfn_info *page,
     1.4          {
     1.5              if ( (x & (PGT_type_mask|PGT_va_mask)) != type )
     1.6              {
     1.7 -                /*
     1.8 -                 * On type change we check to flush stale TLB entries. This 
     1.9 -                 * may be unnecessary (e.g., page was GDT/LDT) but those
    1.10 -                 * circumstances should be very rare.
    1.11 -                 */
    1.12 -                cpumask_t mask = page_get_owner(page)->cpumask;
    1.13 -                tlbflush_filter(mask, page->tlbflush_timestamp);
    1.14 -
    1.15 -                if ( unlikely(!cpus_empty(mask)) )
    1.16 +                if ( (x & PGT_type_mask) != (type & PGT_type_mask) )
    1.17                  {
    1.18 -                    perfc_incrc(need_flush_tlb_flush);
    1.19 -                    flush_tlb_mask(mask);
    1.20 +                    /*
    1.21 +                     * On type change we check to flush stale TLB
    1.22 +                     * entries. This may be unnecessary (e.g., page
    1.23 +                     * was GDT/LDT) but those circumstances should be
    1.24 +                     * very rare.
    1.25 +                     */
    1.26 +                    cpumask_t mask = page_get_owner(page)->cpumask;
    1.27 +                    tlbflush_filter(mask, page->tlbflush_timestamp);
    1.28 +
    1.29 +                    if ( unlikely(!cpus_empty(mask)) )
    1.30 +                    {
    1.31 +                        perfc_incrc(need_flush_tlb_flush);
    1.32 +                        flush_tlb_mask(mask);
    1.33 +                    }
    1.34                  }
    1.35  
    1.36                  /* We lose existing type, back pointer, and validity. */