Skip to contentSkip to conversation

x86: adjust available memory calculation for Dom0 construction

PATCH New Jan Beulich 1 participant 1 message Mar 11, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: adjust available memory calculation for Dom0 construction

With a large number of CPUs, the amount of memory needed to construct the vCPU structures for Dom0 becomes significant and hence should be accounted for when calculating the amount of memory to pass to Dom0.

xen/arch/x86/domain_build.c +7 -0
@@ -155,6 +155,13 @@ static unsigned long __init compute_dom0
     unsigned long min_pages = dom0_min_nrpages;
     unsigned long max_pages = dom0_max_nrpages;
 
+    avail -= (opt_dom0_max_vcpus - 1UL)
+             << get_order_from_bytes(sizeof(struct vcpu));
+#ifdef __x86_64__
+    if ( sizeof_long == sizeof(int) )
+        avail -= opt_dom0_max_vcpus - 1;
+#endif
+
     /*
      * If domain 0 allocation isn't specified, reserve 1/16th of available
      * memory for things like DMA buffers. This reservation is clamped to 

With a large number of CPUs, the amount of memory needed to construct the vCPU structures for Dom0 becomes significant and hence should be accounted for when calculating the amount of memory to pass to Dom0.

xen/arch/x86/domain_build.c +7 -0
@@ -155,6 +155,13 @@ static unsigned long __init compute_dom0
     unsigned long min_pages = dom0_min_nrpages;
     unsigned long max_pages = dom0_max_nrpages;
 
+    avail -= (opt_dom0_max_vcpus - 1UL)
+             << get_order_from_bytes(sizeof(struct vcpu));
+#ifdef __x86_64__
+    if ( sizeof_long == sizeof(int) )
+        avail -= opt_dom0_max_vcpus - 1;
+#endif
+
     /*
      * If domain 0 allocation isn't specified, reserve 1/16th of available
      * memory for things like DMA buffers. This reservation is clamped to 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel