* [PATCH] x86: adjust available memory calculation for Dom0 construction
@ 2010-03-11 16:44 Jan Beulich
0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-03-11 16:44 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 983 bytes --]
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.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- 2010-03-09.orig/xen/arch/x86/domain_build.c 2010-03-09 00:00:00.000000000 +0100
+++ 2010-03-09/xen/arch/x86/domain_build.c 2010-03-10 16:49:52.000000000 +0100
@@ -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
[-- Attachment #2: x86-dom0-alloc-avail.patch --]
[-- Type: text/plain, Size: 977 bytes --]
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.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- 2010-03-09.orig/xen/arch/x86/domain_build.c 2010-03-09 00:00:00.000000000 +0100
+++ 2010-03-09/xen/arch/x86/domain_build.c 2010-03-10 16:49:52.000000000 +0100
@@ -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
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-11 16:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 16:44 [PATCH] x86: adjust available memory calculation for Dom0 construction Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).