All of lore.kernel.org
 help / color / mirror / Atom feed
* Do not wait for memory teardown when live migrate
       [not found] ` <1393810365.50891286801563319.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
@ 2010-10-11 12:52   ` Miroslav Rezanina
  2010-10-11 15:19     ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Miroslav Rezanina @ 2010-10-11 12:52 UTC (permalink / raw)
  To: xen-devel

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.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>:
--
diff -r 3c4c3d48a835 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py	Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py	Mon Oct 11 14:15:01 2010 +0200
@@ -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:
diff -r 3c4c3d48a835 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py	Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendDomain.py	Mon Oct 11 14:15:01 2010 +0200
@@ -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:
-- 
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Do not wait for memory teardown when live migrate
  2010-10-11 12:52   ` Do not wait for memory teardown when live migrate Miroslav Rezanina
@ 2010-10-11 15:19     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2010-10-11 15:19 UTC (permalink / raw)
  To: Miroslav Rezanina; +Cc: xen-devel

On 10/11/2010 02:52 PM, Miroslav Rezanina wrote:
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Do not wait for memory teardown when live migrate
       [not found] <1941181824.152281286870602071.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
       [not found] ` <1393810365.50891286801563319.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
@ 2010-10-12  8:09 ` Miroslav Rezanina
  2010-10-28 10:41   ` Do not wait for memory teardown when live migrate [and 1 more messages] Ian Jackson
  1 sibling, 1 reply; 4+ messages in thread
From: Miroslav Rezanina @ 2010-10-12  8:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: xen-devel


----- "Paolo Bonzini" <pbonzini@redhat.com> wrote:
> >                       raise XendError("%s (from %s)" %
> (m_dsterr.group(2), dst))
> >                   raise
> >           finally:
> > +          if not live:
> >               try:
> >                   sock.shutdown(2)
> >               except:
> 
> Non-standard indentation?

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

diff -r 3c4c3d48a835 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py	Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py	Tue Oct 12 10:08:32 2010 +0200
@@ -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:
diff -r 3c4c3d48a835 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py	Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/XendDomain.py	Tue Oct 12 10:08:32 2010 +0200
@@ -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,15 +1436,16 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
-            try:
-                sock.shutdown(2)
-            except:
-                # Probably the socket is already disconnected by sock.close
-                # in the destination side.
-                # Ignore the exception because it has nothing to do with
-                # an exception of XendCheckpoint.save.
-                pass
-            sock.close()
+            if not live:
+                try:
+                    sock.shutdown(2)
+                except:
+                    # Probably the socket is already disconnected by sock.close
+                    # in the destination side.
+                    # Ignore the exception because it has nothing to do with
+                    # an exception of XendCheckpoint.save.
+                    pass
+                sock.close()
 
         os.close(p2cread)
         os.close(p2cwrite)
@@ -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,15 +1494,16 @@
                     raise XendError("%s (from %s)" % (m_dsterr.group(2), dst))
                 raise
         finally:
-            try:
-                sock.shutdown(2)
-            except:
-                # Probably the socket is already disconnected by sock.close
-                # in the destination side.
-                # Ignore the exception because it has nothing to do with
-                # an exception of XendCheckpoint.save.
-                pass
-            sock.close()
+            if not live:
+                try:
+                    sock.shutdown(2)
+                except:
+                    # Probably the socket is already disconnected by sock.close
+                    # in the destination side.
+                    # Ignore the exception because it has nothing to do with
+                    # an exception of XendCheckpoint.save.
+                    pass
+                sock.close()
 
     def domain_save(self, domid, dst, checkpoint=False):
         """Start saving a domain to file.
-- 
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Do not wait for memory teardown when live migrate [and 1 more messages]
  2010-10-12  8:09 ` Miroslav Rezanina
@ 2010-10-28 10:41   ` Ian Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2010-10-28 10:41 UTC (permalink / raw)
  To: Miroslav Rezanina; +Cc: Paolo Bonzini, xen-devel

Miroslav Rezanina writes ("[Xen-devel] Do not wait for memory teardown when live migrate"):
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-28 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1941181824.152281286870602071.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
     [not found] ` <1393810365.50891286801563319.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-11 12:52   ` Do not wait for memory teardown when live migrate Miroslav Rezanina
2010-10-11 15:19     ` Paolo Bonzini
2010-10-12  8:09 ` Miroslav Rezanina
2010-10-28 10:41   ` Do not wait for memory teardown when live migrate [and 1 more messages] Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.