aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain_save.c
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2011-05-26 15:27:33 +0100
committerGeorge Dunlap <george.dunlap@eu.citrix.com>2011-05-26 15:27:33 +0100
commitf35c8f6857b19f2278b73b55bb64d4fc8fb56c75 (patch)
treefd767602ffdefe4205122ee551052aeef3e22875 /tools/libxc/xc_domain_save.c
parentbc14571cb1c03ed1691a520f444828f36b605116 (diff)
downloadxen-f35c8f6857b19f2278b73b55bb64d4fc8fb56c75.tar.gz
xen-f35c8f6857b19f2278b73b55bb64d4fc8fb56c75.tar.bz2
xen-f35c8f6857b19f2278b73b55bb64d4fc8fb56c75.zip
tools: Introduce "allocate-only" page type for migration
To detect presence of superpages on the receiver side, we need to have strings of sequential pfns sent across on the first iteration through the memory. However, as we go through the memory, more and more of it will be marked dirty, making it wasteful to send those pages. This patch introduces a new PFINFO type, "XALLOC". Like PFINFO_XTAB, it indicates that there is no corresponding page present in the subsquent page buffer. However, unlike PFINFO_XTAB, it contains a pfn which should be allocated. This new type is only used for migration; but it's placed in xen/public/domctl.h so that the value isn't reused. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_save.c')
-rw-r--r--tools/libxc/xc_domain_save.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 0c0e2fabde..aec822c6c2 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1155,13 +1155,15 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
}
else
{
- if ( !last_iter &&
+ int dont_skip = (last_iter || (superpages && iter==1));
+
+ if ( !dont_skip &&
test_bit(n, to_send) &&
test_bit(n, to_skip) )
skip_this_iter++; /* stats keeping */
if ( !((test_bit(n, to_send) && !test_bit(n, to_skip)) ||
- (test_bit(n, to_send) && last_iter) ||
+ (test_bit(n, to_send) && dont_skip) ||
(test_bit(n, to_fix) && last_iter)) )
continue;
@@ -1174,7 +1176,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
/*
** we get here if:
** 1. page is marked to_send & hasn't already been re-dirtied
- ** 2. (ignore to_skip in last iteration)
+ ** 2. (ignore to_skip in first and last iterations)
** 3. add in pages that still need fixup (net bufs)
*/
@@ -1198,7 +1200,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
set_bit(n, to_fix);
continue;
}
-
+
if ( last_iter &&
test_bit(n, to_fix) &&
!test_bit(n, to_send) )
@@ -1243,6 +1245,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
{
if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
continue;
+
DPRINTF("map fail: page %i mfn %08lx err %d\n",
j, gmfn, pfn_err[j]);
pfn_type[j] = XEN_DOMCTL_PFINFO_XTAB;
@@ -1255,6 +1258,9 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
continue;
}
+ if ( superpages && iter==1 && test_bit(gmfn, to_skip))
+ pfn_type[j] = XEN_DOMCTL_PFINFO_XALLOC;
+
/* canonicalise mfn->pfn */
pfn_type[j] |= pfn_batch[j];
++run;
@@ -1329,8 +1335,9 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
}
}
- /* skip pages that aren't present */
- if ( pagetype == XEN_DOMCTL_PFINFO_XTAB )
+ /* skip pages that aren't present or are alloc-only */
+ if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+ || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
continue;
pagetype &= XEN_DOMCTL_PFINFO_LTABTYPE_MASK;