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-ppc-devel

[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] no need to allocate extents

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [TOOLS][POWERPC] no need to allocate extents in a loop
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Nov 2006 00:50:58 +0000
Delivery-date: Tue, 14 Nov 2006 17:56:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID b17300195f02f7da17f3ad94aed955863ffd4fed
# Parent  b35682af48d01ddba1d26e6fe2d0c5607a343228
[TOOLS][POWERPC] no need to allocate extents in a loop

This patch decreases the number of hcalls needed to allocate all the
extents for a domain with large amounts of memory.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r b35682af48d0 -r b17300195f02 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Nov 13 14:32:55 2006 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Nov 14 19:46:26 2006 -0500
@@ -2017,6 +2017,10 @@ class XendDomainInfo (Common_XendDomainI
         if memory < rma_kb:
             raise ValueError("Domain memory must be at least %d KB" % rma_kb)
 
+        if memory & (16 << 10):
+            raise ValueError("Domain memory %dKB must be a multiple of 16MB"
+                             % memory)
+
         # allocate the RMA
         log.debug("alloc_real_mode_area(%d, %d)", self.domid, rma_log)
         xc.alloc_real_mode_area(self.domid, rma_log)
@@ -2024,13 +2028,11 @@ class XendDomainInfo (Common_XendDomainI
         # now allocate the remaining memory as large-order allocations
         memory -= rma_kb
         extent_log = 24 # 16 MB
-        extent_size = 1 << extent_log
         page_log = 12 # 4 KB
         extent_order = extent_log - page_log
-        for i in range(0, memory * 1024, extent_size):
-            log.debug("increase_reservation(%d, 0x%x, %d)", self.domid,
-                    extent_size >> 10, extent_order)
-            xc.domain_memory_increase_reservation(self.domid,
-                                                  extent_size >> 10,
-                                                  extent_order)
-
+        log.debug("increase_reservation(%d, 0x%x, %d)", self.domid,
+                  memory, extent_order)
+        xc.domain_memory_increase_reservation(self.domid,
+                                              memory,
+                                              extent_order)
+

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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [TOOLS][POWERPC] no need to allocate extents in a loop, Xen patchbot-xenppc-unstable <=