WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 17/18] xenpaging: add dynamic startup delay for xenpa

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 17/18] xenpaging: add dynamic startup delay for xenpaging
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 15 Oct 2010 16:12:19 +0200
Delivery-date: Fri, 15 Oct 2010 07:30:13 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1287151941; l=3805; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=xUw+4M0dK6gvv7V0jX07fzRCS74=; b=MUhX52kdowS94rilUrn9WlsPltyApCHPlNhhS4L8K/YqsAXr9UJOvlQZZO9CRPHRngp CK0huHuEkA5citBlBXuV0EMuYSlxBimub+wrJslhW3n/j4V2Wq4/Uu4EAl6m5V1KZksr+ 2INOS4CF4ycOQF9zXDFvNhyDBGmkq8B379o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20101015141202.309585877@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-4.4
This is a debug helper. Since the xenpaging support is still fragile, run
xenpaging at different stages in the bootprocess. Different delays will trigger
more bugs. This implementation starts without delay for 5 reboots, then
increments the delay by 0.1 seconds It uses xenstore for presistant storage of
delay values

TODO: find the correct place to remove the xenstore directory when the guest is 
shutdown or crashed

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 tools/python/xen/xend/image.py |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

--- xen-4.0.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.1-testing/tools/python/xen/xend/image.py
@@ -123,6 +123,18 @@ class ImageHandler:
 
         self.device_model = vmConfig['platform'].get('device_model')
         self.xenpaging = vmConfig['platform'].get('xenpaging')
+        self.xenpaging_delay = 
xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay" % 
self.vm.info['name_label'])
+        if self.xenpaging_delay == None:
+            log.warn("XXX creating /local/domain/0/xenpaging/%s % 
self.vm.info['name_label'])
+            xstransact.Mkdir("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'])
+            xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay', '0.0'))
+            xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay_inc', '0.1'))
+            xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay_use', '5'))
+            xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay_used', '0'))
+        self.xenpaging_delay = 
float(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay" % 
self.vm.info['name_label']))
+        self.xenpaging_delay_inc = 
float(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_inc" % 
self.vm.info['name_label']))
+        self.xenpaging_delay_use = 
int(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_use" % 
self.vm.info['name_label']))
+        self.xenpaging_delay_used = 
int(xstransact.Read("/local/domain/0/xenpaging/%s/xenpaging_delay_used" % 
self.vm.info['name_label']))
 
         self.display = vmConfig['platform'].get('display')
         self.xauthority = vmConfig['platform'].get('xauthority')
@@ -401,6 +413,17 @@ class ImageHandler:
             return
         if self.xenpaging_pid:
             return
+        if self.xenpaging_delay_used < self.xenpaging_delay_use:
+            self.xenpaging_delay_used += 1
+        else:
+            self.xenpaging_delay_used = 0
+            self.xenpaging_delay += self.xenpaging_delay_inc
+        log.info("delay_used %s" % self.xenpaging_delay_used)
+        log.info("delay_use %s" % self.xenpaging_delay_use)
+        log.info("delay %s" % self.xenpaging_delay)
+        log.info("delay_inc %s" % self.xenpaging_delay_inc)
+        xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay', self.xenpaging_delay))
+        xstransact.Store("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'], ('xenpaging_delay_used', self.xenpaging_delay_used))
         xenpaging_bin = auxbin.pathTo("xenpaging")
         args = [xenpaging_bin]
         args = args + ([ "%d" % self.vm.getDomid()])
@@ -430,6 +453,9 @@ class ImageHandler:
                 except:
                     log.warn("chdir %s failed" % xenpaging_dir)
                 try:
+                    if self.xenpaging_delay != 0.0:
+                        log.info("delaying xenpaging startup %s seconds ..." % 
self.xenpaging_delay)
+                        time.sleep(self.xenpaging_delay)
                     log.info("starting %s" % args)
                     os.execve(xenpaging_bin, args, env)
                 except Exception, e:
@@ -449,6 +475,8 @@ class ImageHandler:
     def destroyXenPaging(self):
         if self.xenpaging is None:
             return
+        # FIXME find correct place for guest shutdown or crash
+        #xstransact.Remove("/local/domain/0/xenpaging/%s" % 
self.vm.info['name_label'])
         if self.xenpaging_pid:
             try:
                 os.kill(self.xenpaging_pid, signal.SIGHUP)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>