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] Cleanup allocMem() method

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [TOOLS][POWERPC] Cleanup allocMem() method
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Nov 2006 17:19:36 +0000
Delivery-date: Sat, 11 Nov 2006 09:22:34 -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 3b1358032f6ad2542e63848681c913a583274fa3
# Parent  6a9ae49a3bfe5e2bf2fcff3a179a1c5583863df1
[TOOLS][POWERPC] Cleanup allocMem() method

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

diff -r 6a9ae49a3bfe -r 3b1358032f6a tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 10 18:41:25 2006 -0500
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 10 18:42:22 2006 -0500
@@ -1310,6 +1310,9 @@ class Common_XendDomainInfo:
             shadow_cur = xc.shadow_mem_control(self.domid, shadow / 1024)
             self.info['shadow_memory'] = shadow_cur
 
+            ### PPC
+            self.allocMem()
+            
             self._createChannels()
 
             channel_details = self.image.createImage()
@@ -1333,38 +1336,8 @@ class Common_XendDomainInfo:
             raise VmError(str(exn))
 
     def allocMem(self):
-        # Use architecture- and image-specific calculations to determine
-        # the various headrooms necessary, given the raw configured
-        # values.
-        # reservation, maxmem, memory, and shadow are all in KiB.
-        reservation = self.image.getRequiredInitialReservation(
-            self.info['memory'] * 1024)
-        maxmem = self.image.getRequiredAvailableMemory(
-            self.info['maxmem'] * 1024)
-        memory = self.image.getRequiredAvailableMemory(
-            self.info['memory'] * 1024)
-        shadow = self.image.getRequiredShadowMemory(
-            self.info['shadow_memory'] * 1024,
-            self.info['maxmem'] * 1024)
-
-        # Round shadow up to a multiple of a MiB, as shadow_mem_control
-        # takes MiB and we must not round down and end up under-providing.
-        shadow = ((shadow + 1023) / 1024) * 1024
-
-        # set memory limit
-        xc.domain_setmaxmem(self.domid, maxmem)
-
-        # Make sure there's enough RAM available for the domain
-        balloon.free(memory + shadow)
-
-        # Set up the shadow memory
-        shadow_cur = xc.shadow_mem_control(self.domid, shadow / 1024)
-        self.info['shadow_memory'] = shadow_cur
-
-        # initial memory reservation
-        xc.domain_memory_increase_reservation(self.domid, reservation, 0,
-                                              0)
-
+        # only for PPC
+        return
 
     def cleanupDomain(self):
         """Cleanup domain resources; release devices.  Idempotent.  Nothrow
@@ -2025,33 +1998,8 @@ class XendDomainInfo (Common_XendDomainI
         return self._rmaLogs[cputype]
  
     def allocMem(self):
-        # Use architecture- and image-specific calculations to determine
-        # the various headrooms necessary, given the raw configured
-        # values.
-        # reservation, maxmem, memory, and shadow are all in KiB.
-        reservation = self.image.getRequiredInitialReservation(
-            self.info['memory'] * 1024)
-        maxmem = self.image.getRequiredAvailableMemory(
-            self.info['maxmem'] * 1024)
         memory = self.image.getRequiredAvailableMemory(
             self.info['memory'] * 1024)
-        shadow = self.image.getRequiredShadowMemory(
-            self.info['shadow_memory'] * 1024,
-            self.info['maxmem'] * 1024)
-        # Round shadow up to a multiple of a MiB, as shadow_mem_control
-        # takes MiB and we must not round down and end up under-providing.
-        shadow = ((shadow + 1023) / 1024) * 1024
- 
-        # set memory limit
-        xc.domain_setmaxmem(self.domid, maxmem)
-        dev_uuid = self.info.device_add('vtpm', cfg_xenapi = xenapi_vtpm)
- 
-        # Make sure there's enough RAM available for the domain
-        balloon.free(memory + shadow)
- 
-        # Set up the shadow memory, i.e. the PowerPC hash table
-        shadow_cur = xc.shadow_mem_control(self.domid, shadow / 1024)
-        self.info['shadow_memory'] = shadow_cur
  
         rma_log = 26 ### self.info['powerpc_rma_log']
         if rma_log == 0:
@@ -2070,6 +2018,7 @@ class XendDomainInfo (Common_XendDomainI
             raise ValueError("Domain memory must be at least %d KB" % rma_kb)
 
         # allocate the RMA
+        log.debug("alloc_real_mode_area(%d, %d)", self.domid, rma_log)
         xc.alloc_real_mode_area(self.domid, rma_log)
 
         # now allocate the remaining memory as large-order allocations

_______________________________________________
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] Cleanup allocMem() method, Xen patchbot-xenppc-unstable <=