WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86: do pmd_populate with lazy mmu updates

To: "H. Peter Anvin" <hpa@xxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: do pmd_populate with lazy mmu updates
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 20 Dec 2010 15:47:00 -0800
Cc: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Mon, 20 Dec 2010 15:47:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7
This allows the set_pmd to be batched with whatever setup
paravirt_alloc_pte() needs to do.  pmd_populate() is always called
under the pagetable lock, so this is safe.

With a corresponding change in the Xen-specific code, this allows
the setup of a new pte page to be done with 1 hypercall rather than 3.
This results in a 3-8% improvement in fork performance, depending on
process size (more improvement on larger processes).  I expect a similar
improvement in time spent touching a virgin part of the address space.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index 271de94..15e1153f 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -71,8 +71,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t 
*pmd,
 {
        unsigned long pfn = page_to_pfn(pte);
 
+       arch_enter_lazy_mmu_mode();
        paravirt_alloc_pte(mm, pfn);
        set_pmd(pmd, __pmd(((pteval_t)pfn << PAGE_SHIFT) | _PAGE_TABLE));
+       arch_leave_lazy_mmu_mode();
 }
 
 #define pmd_pgtable(pmd) pmd_page(pmd)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: do pmd_populate with lazy mmu updates, Jeremy Fitzhardinge <=