diff options
author | David Vrabel <david.vrabel@citrix.com> | 2015-03-11 10:49:57 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-03-16 10:49:15 -0400 |
commit | 4e8c0c8c4bf3a5b5c98046e146ab3884bf7a7d0e (patch) | |
tree | e2da5980fd405c7109a342b13f0a2a1214f94b61 /include/xen/xen-ops.h | |
parent | 628c28eefd6f2cef03b212081b466ae43fd093a3 (diff) |
xen/privcmd: improve performance of MMAPBATCH_V2
Make the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version) map
multiple frames at a time rather than one at a time, despite the pages
being non-consecutive GFNs.
xen_remap_foreign_mfn_array() is added which maps an array of GFNs
(instead of a consecutive range of GFNs).
Since per-frame errors are returned in an array, privcmd must set the
MMAPBATCH_V1 error bits as part of the "report errors" phase, after
all the frames are mapped.
Migrate times are significantly improved (when using a PV toolstack
domain). For example, for an idle 12 GiB PV guest:
Before After
real 0m38.179s 0m26.868s
user 0m15.096s 0m13.652s
sys 0m28.988s 0m18.732s
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'include/xen/xen-ops.h')
-rw-r--r-- | include/xen/xen-ops.h | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 9eb88a4512bd..c643e6a94c9a 100644 --- a/include/xen/xen-ops.h +++ b/include/xen/xen-ops.h | |||
@@ -27,17 +27,54 @@ int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, | |||
27 | void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order); | 27 | void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order); |
28 | 28 | ||
29 | struct vm_area_struct; | 29 | struct vm_area_struct; |
30 | |||
31 | /* | ||
32 | * xen_remap_domain_mfn_array() - map an array of foreign frames | ||
33 | * @vma: VMA to map the pages into | ||
34 | * @addr: Address at which to map the pages | ||
35 | * @gfn: Array of GFNs to map | ||
36 | * @nr: Number entries in the GFN array | ||
37 | * @err_ptr: Returns per-GFN error status. | ||
38 | * @prot: page protection mask | ||
39 | * @domid: Domain owning the pages | ||
40 | * @pages: Array of pages if this domain has an auto-translated physmap | ||
41 | * | ||
42 | * @gfn and @err_ptr may point to the same buffer, the GFNs will be | ||
43 | * overwritten by the error codes after they are mapped. | ||
44 | * | ||
45 | * Returns the number of successfully mapped frames, or a -ve error | ||
46 | * code. | ||
47 | */ | ||
48 | int xen_remap_domain_mfn_array(struct vm_area_struct *vma, | ||
49 | unsigned long addr, | ||
50 | xen_pfn_t *gfn, int nr, | ||
51 | int *err_ptr, pgprot_t prot, | ||
52 | unsigned domid, | ||
53 | struct page **pages); | ||
54 | |||
55 | /* xen_remap_domain_mfn_range() - map a range of foreign frames | ||
56 | * @vma: VMA to map the pages into | ||
57 | * @addr: Address at which to map the pages | ||
58 | * @gfn: First GFN to map. | ||
59 | * @nr: Number frames to map | ||
60 | * @prot: page protection mask | ||
61 | * @domid: Domain owning the pages | ||
62 | * @pages: Array of pages if this domain has an auto-translated physmap | ||
63 | * | ||
64 | * Returns the number of successfully mapped frames, or a -ve error | ||
65 | * code. | ||
66 | */ | ||
30 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | 67 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
31 | unsigned long addr, | 68 | unsigned long addr, |
32 | xen_pfn_t mfn, int nr, | 69 | xen_pfn_t gfn, int nr, |
33 | pgprot_t prot, unsigned domid, | 70 | pgprot_t prot, unsigned domid, |
34 | struct page **pages); | 71 | struct page **pages); |
35 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | 72 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, |
36 | int numpgs, struct page **pages); | 73 | int numpgs, struct page **pages); |
37 | int xen_xlate_remap_gfn_range(struct vm_area_struct *vma, | 74 | int xen_xlate_remap_gfn_array(struct vm_area_struct *vma, |
38 | unsigned long addr, | 75 | unsigned long addr, |
39 | xen_pfn_t gfn, int nr, | 76 | xen_pfn_t *gfn, int nr, |
40 | pgprot_t prot, | 77 | int *err_ptr, pgprot_t prot, |
41 | unsigned domid, | 78 | unsigned domid, |
42 | struct page **pages); | 79 | struct page **pages); |
43 | int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma, | 80 | int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma, |