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

[Xen-ia64-devel] [Patch] allocate all memory to dom0

To: "xen-ia64-devel" <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] [Patch] allocate all memory to dom0
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Thu, 18 Jan 2007 13:06:56 +0900
Delivery-date: Wed, 17 Jan 2007 20:05:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

If we don't specify dom0_mem, we can use all memory on dom0 with this patch.
I change alloc_dom0() to alloc_dom0_size(), and alloc_dom0_size() is static 
function.

# HG changeset patch
# User root@PQtest
# Node ID 1625e2ba02fcb2c7d162e178a045b7d540a213f1
# Parent  a2b2b2a011f1d406d49caba478020f3b2b173cb8
allocate all memory to dom0, if we don't specify dom0_mem.

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>

diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Mon Jan 15 15:15:26 2007 -0700
+++ b/xen/arch/ia64/xen/domain.c        Thu Jan 18 13:45:00 2007 +0900
@@ -50,7 +50,7 @@
 #include <asm/tlb_track.h>
 #include <asm/perfmon.h>
 
-unsigned long dom0_size = 512*1024*1024;
+unsigned long dom0_size = 0;
 
 /* dom0_max_vcpus: maximum number of VCPUs to create for dom0.  */
 static unsigned int dom0_max_vcpus = 1;
@@ -936,16 +936,24 @@ static void loaddomainelfimage(struct do
        }
 }
 
-void alloc_dom0(void)
-{
+static void alloc_dom0_size(void)
+{
+       unsigned long max_dom0_pages;
+
+       if ( dom0_size == 0 )
+       {
+               max_dom0_pages = avail_domheap_pages() - 
min(avail_domheap_pages() / 16UL, 512UL << (20 - PAGE_SHIFT)) ;
+               dom0_size = max_dom0_pages * PAGE_SIZE;
+       }
+
+       if (running_on_sim) {
+               dom0_size = 128*1024*1024; //FIXME: Should be configurable
+       }
+
        /* Check dom0 size.  */
        if (dom0_size < 4 * 1024 * 1024) {
                panic("dom0_mem is too small, boot aborted"
                        " (try e.g. dom0_mem=256M or dom0_mem=65536K)\n");
-       }
-
-       if (running_on_sim) {
-               dom0_size = 128*1024*1024; //FIXME: Should be configurable
        }
 
        /* no need to allocate pages for now
@@ -1008,6 +1016,8 @@ int construct_dom0(struct domain *d,
        memset(&dsi, 0, sizeof(struct domain_setup_info));
 
        printk("*** LOADING DOMAIN 0 ***\n");
+
+       alloc_dom0_size();
 
        max_pages = dom0_size / PAGE_SIZE;
        d->max_pages = max_pages;
diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Mon Jan 15 15:15:26 2007 -0700
+++ b/xen/arch/ia64/xen/xensetup.c      Thu Jan 18 13:45:00 2007 +0900
@@ -43,7 +43,6 @@ extern void early_setup_arch(char **);
 extern void early_setup_arch(char **);
 extern void late_setup_arch(char **);
 extern void hpsim_serial_init(void);
-extern void alloc_dom0(void);
 extern void setup_per_cpu_areas(void);
 extern void mem_init(void);
 extern void init_IRQ(void);
@@ -409,8 +408,6 @@ void start_kernel(void)
 
     trap_init();
 
-    alloc_dom0();
-
     end_boot_allocator();
 
     init_xenheap_pages(__pa(xen_heap_start), xenheap_phys_end);

Best Regards,

Akio Takebe

Attachment: allocate_all_mem.patch
Description: Binary data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>