ia64/xen-unstable

changeset 6155:050bf85fb870

Add "set_pte_at_sync" (integrated invlpg) in Linux i386/mm/highmem.c to improve performance for domains with >900MB of memory.

Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Sat Aug 13 21:52:46 2005 +0000 (2005-08-13)
parents 08d19da852c7
children 323a46d272ff de0127d6e06b
files linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Sat Aug 13 21:26:49 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c	Sat Aug 13 21:52:46 2005 +0000
     1.3 @@ -41,8 +41,7 @@ static void *__kmap_atomic(struct page *
     1.4  	if (!pte_none(*(kmap_pte-idx)))
     1.5  		BUG();
     1.6  #endif
     1.7 -	set_pte(kmap_pte-idx, mk_pte(page, prot));
     1.8 -	__flush_tlb_one(vaddr);
     1.9 +	set_pte_at_sync(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
    1.10  
    1.11  	return (void*) vaddr;
    1.12  }
     2.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Sat Aug 13 21:26:49 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Sat Aug 13 21:52:46 2005 +0000
     2.3 @@ -25,6 +25,17 @@ inline static void set_pte_at(struct mm_
     2.4      }
     2.5  }
     2.6  
     2.7 +inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
     2.8 +		       pte_t *ptep, pte_t val )
     2.9 +{
    2.10 +    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    2.11 +	 HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
    2.12 +    {
    2.13 +        set_pte(ptep, val);
    2.14 +	xen_invlpg(addr);
    2.15 +    }
    2.16 +}
    2.17 +
    2.18  #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
    2.19  
    2.20  #ifndef CONFIG_XEN_SHADOW_MODE
     3.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Sat Aug 13 21:26:49 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Sat Aug 13 21:52:46 2005 +0000
     3.3 @@ -79,6 +79,17 @@ inline static void set_pte_at(struct mm_
     3.4      }
     3.5  }
     3.6  
     3.7 +inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
     3.8 +		       pte_t *ptep, pte_t val )
     3.9 +{
    3.10 +    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    3.11 +	 HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
    3.12 +    {
    3.13 +        set_pte(ptep, val);
    3.14 +	xen_invlpg(addr);
    3.15 +    }
    3.16 +}
    3.17 +
    3.18  #ifdef CONFIG_XEN_SHADOW_MODE
    3.19  # define set_pmd(pmdptr,pmdval) \
    3.20  		set_64bit((unsigned long long *)(pmdptr),pmd_val(pmdval))