Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753722Ab0LOWVD (ORCPT ); Wed, 15 Dec 2010 17:21:03 -0500 Received: from claw.goop.org ([74.207.240.146]:47885 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881Ab0LOWUM (ORCPT ); Wed, 15 Dec 2010 17:20:12 -0500 From: Jeremy Fitzhardinge To: Andrew Morton Cc: Haavard Skinnemoen , Linux-MM , Linux Kernel Mailing List , Nick Piggin , Xen-devel , Jeremy Fitzhardinge Subject: [PATCH 8/9] xen/mmu: use apply_to_page_range_batch() in xen_remap_domain_mfn_range() Date: Wed, 15 Dec 2010 14:19:54 -0800 Message-Id: <8ab8e7f173f9bf7b7ec131bd92d4591ba207a905.1292450600.git.jeremy.fitzhardinge@citrix.com> X-Mailer: git-send-email 1.7.3.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 55 From: Jeremy Fitzhardinge Signed-off-by: Jeremy Fitzhardinge --- arch/x86/xen/mmu.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 2b2b98a..930bddc 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -2656,14 +2656,19 @@ struct remap_data { struct mmu_update *mmu_update; }; -static int remap_area_mfn_pte_fn(pte_t *ptep, unsigned long addr, void *data) +static int remap_area_mfn_pte_fn(pte_t *ptep, unsigned count, + unsigned long addr, void *data) { struct remap_data *rmd = data; - pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot)); - rmd->mmu_update->ptr = arbitrary_virt_to_machine(ptep).maddr; - rmd->mmu_update->val = pte_val_ma(pte); - rmd->mmu_update++; + while (count--) { + pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot)); + + rmd->mmu_update->ptr = arbitrary_virt_to_machine(ptep).maddr; + rmd->mmu_update->val = pte_val_ma(pte); + rmd->mmu_update++; + ptep++; + } return 0; } @@ -2692,8 +2697,8 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, range = (unsigned long)batch << PAGE_SHIFT; rmd.mmu_update = mmu_update; - err = apply_to_page_range(vma->vm_mm, addr, range, - remap_area_mfn_pte_fn, &rmd); + err = apply_to_page_range_batch(vma->vm_mm, addr, range, + remap_area_mfn_pte_fn, &rmd); if (err) goto out; -- 1.7.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/