|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] Improve performance of IOCTL_PRIVCMD_MMAPBATCH_V2
On 16/11/12 15:48, David Vrabel wrote: I originally had another argument to the function of "contiguous" - but found that in both places this function is called, it had both contiguous and err_ptr either "1, NULL" or "0, not-NULL". So I thought "why not save one argument".On 16/11/12 14:45, Mats Petersson wrote: Add "xen/privcmd:" prefix to subject.This patch makes the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version) map multiple (typically 1024) pages at a time rather than one page at a time, despite the pages being non-consecutive MFNs. The main change is to pass a pointer to an array of mfns, rather than one mfn. To support error reporting, we also pass an err_ptr. If err_ptr is NULL, it indicates we want the contiguous pages behaviour, so the mfn value is incremented rather than the pointer itself. Performance of mapping guest memory into Dom0 is improved by a factor of around 6 with this change.Can you include details on the test and the raw figures as well?Signed-off-by: Mats Petersson <mats.petersson@xxxxxxxxxx> --- arch/x86/xen/mmu.c | 47 ++++++++++++++++++++++++++------- drivers/xen/privcmd.c | 70 ++++++++++++++++++++++++++++++++++++++++++------- include/xen/xen-ops.h | 5 ++-- 3 files changed, 100 insertions(+), 22 deletions(-) diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index dcf5f2d..c5e23ba 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -2477,7 +2477,8 @@ void __init xen_hvm_init_mmu_ops(void) #define REMAP_BATCH_SIZE 16struct remap_data {- unsigned long mfn; + unsigned long *mfn; + int contiguous;bool. Do you foresee these functions being called from many other places? The original xen_remap_mfn_range() takes mfn and nr, so I think if we
have two functions, the original function should remain as before (to
reduce the amount of changes). It also makes the common function more
symmetrical between the two cases, as we'd have to back-calculate the
"nr" argument - we clearly can't know "end_mfn" in the array case.
It would be nice if the API calls had some docs as well (e.g., in kernel-doc style). Yes, that would be nice, wouldn't it. I'll add something. -- Mats David _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |