Skip to contentSkip to conversation

Do not wait for memory teardown when live migrate

PATCH Miroslav Rezanina 3 participants 4 messages Oct 11, 2010 – Oct 28, 2010 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1941181824.152281286870602071.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com

#1 lore raw
Quoted 10 lines · ----- "Paolo Bonzini
Quoted 1 line

raise XendError("%s (from %s)" %

(m_dsterr.group(2), dst))

Quoted 6 lines

raise
finally:
+ if not live:
try:
sock.shutdown(2)
except:

Non-standard indentation?

Yeah, sorry for lazyness...This is correctly indented version.

Quoted 1 line
tools/python/xen/xend/XendCheckpoint.py +8 -1
diff -r 3c4c3d48a835 tools/python/xen/xend/XendCheckpoint.py
@@ -65,7 +65,7 @@
     return
 
 
-def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1,sock=None):
     from xen.xend import XendDomain
 
     try:
@@ -162,6 +162,13 @@
         if checkpoint:
             dominfo.resumeDomain()
         else:
+            if live and sock != None:
+                try:
+                    sock.shutdown(2)
+                except:
+                    pass
+                sock.close()
+
             dominfo.destroy()
             dominfo.testDeviceComplete()
         try:
tools/python/xen/xend/XendDomain.py +22 -20

66 lines not on this page · raw message

Signature · 2 lines
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel

A message that is not in the archive (sent off-list or not yet received): 1393810365.50891286801563319.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com

#3 lore raw

Hi,
when trying to live migrate guest with great memory (e.g. 20 GB), there's delay caused by destroying source copy of domain. To speed up this process we can close socket before starting guest destroy, as source guest is not running anymore.

--

tools/python/xen/xend/XendCheckpoint.py +8 -1
diff -r 3c4c3d48a835 tools/python/xen/xend/XendCheckpoint.py
@@ -65,7 +65,7 @@
     return
 
 
-def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1,sock=None):
     from xen.xend import XendDomain
 
     try:
@@ -162,6 +162,13 @@
         if checkpoint:
             dominfo.resumeDomain()
         else:
+            if live and sock != None:
+                try:
+                    sock.shutdown(2)
+                except:
+                    pass
+                sock.close()
+
             dominfo.destroy()
             dominfo.testDeviceComplete()
         try:
tools/python/xen/xend/XendDomain.py +4 -2
diff -r 3c4c3d48a835 tools/python/xen/xend/XendDomain.py
@@ -1412,7 +1412,7 @@
         try:
             try:
                 XendCheckpoint.save(p2cwrite, dominfo, True, live, dst,
-                                    node=node)
+                                    node=node,sock=sock)
             except Exception, ex:
                 m_dsterr = None
                 try:
@@ -1436,6 +1436,7 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
+          if not live:
             try:
                 sock.shutdown(2)
             except:
@@ -1469,7 +1470,7 @@
         try:
             try:
                 XendCheckpoint.save(sock.fileno(), dominfo, True, live,
-                                    dst, node=node)
+                                    dst, node=node,sock=sock)
             except Exception, ex:
                 m_dsterr = None
                 try:
@@ -1493,6 +1494,7 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
+          if not live:
             try:
                 sock.shutdown(2)
             except:
Signature · 2 lines
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel
#4 lore raw

tools/python/xen/xend/XendDomain.py line 1500

Quoted 8 lines · Miroslav Rezanina
tools/python/xen/xend/XendDomain.py +1 -0
@@ -1493,6 +1494,7 @@
                      raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                  raise
          finally:
+          if not live:
              try:
                  sock.shutdown(2)
              except:

Non-standard indentation?

Paolo

#5 lore raw

Re: Do not wait for memory teardown when live migrate [and 1 more messages]

In reply to Miroslav Rezanina

Miroslav Rezanina writes ("[Xen-devel] Do not wait for memory teardown when live migrate"):

Quoted 4 lines

when trying to live migrate guest with great memory (e.g. 20 GB), there's delay caused by destroying source copy of domain. To speed up this process we can close socket before starting guest destroy, as source guest is not running anymore.

Thanks, I've applied the re-indented version. Do you do any tests with xl / libxl ? It would be nice to know whether there is a corresponding issue with xl (I think there shouldn't be). xl and libxl are the future and xend is going to be deprecated.

Ian.