[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEN] Clamp dom0 memory and CPUs to fit in available resources.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 4d1b44450bdb2d36e163bc3fee110c7dcadb292b
# Parent  9943e06e966e24773459c654975310f36ba5daa2
[XEN] Clamp dom0 memory and CPUs to fit in available resources.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/domain_build.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 9943e06e966e -r 4d1b44450bdb xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Wed Oct 18 17:41:36 2006 +0100
+++ b/xen/arch/x86/domain_build.c       Wed Oct 18 17:45:19 2006 +0100
@@ -286,7 +286,8 @@ int construct_dom0(struct domain *d,
         nr_pages = avail_domheap_pages() + initial_images_nrpages() +
             dom0_nrpages;
     else
-        nr_pages = dom0_nrpages;
+        nr_pages = min(avail_domheap_pages() + initial_images_nrpages(),
+                       (unsigned long)dom0_nrpages);
 
     if ( (rc = parseelfimage(&dsi)) != 0 )
         return rc;
@@ -668,6 +669,8 @@ int construct_dom0(struct domain *d,
 
     if ( opt_dom0_max_vcpus == 0 )
         opt_dom0_max_vcpus = num_online_cpus();
+    if ( opt_dom0_max_vcpus > num_online_cpus() )
+        opt_dom0_max_vcpus = num_online_cpus();
     if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
         opt_dom0_max_vcpus = MAX_VIRT_CPUS;
     printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.